docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RangeGeneratorBase

    Base implementation of the builtin IRangeGenerator. Runs the necessary parameter validation before calling GetRangesInternal(int, int, int, Output<Range>).

    Inheritance
    object
    RangeGeneratorBase
    LeftDirectionRangeGenerator
    RightDirectionRangeGenerator
    Implements
    IRangeGenerator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.InferenceEngine.Tokenization.Truncators
    Assembly: Unity.InferenceEngine.Tokenization.dll
    Syntax
    public abstract class RangeGeneratorBase : IRangeGenerator

    Methods

    GetRanges(int, int, int, Output<Range>)

    Generates a sequence of chunks based on the length of the source, the maximum size of those chunks, and a stride.

    Declaration
    public int GetRanges(int length, int rangeMaxLength, int stride, Output<Range> output)
    Parameters
    Type Name Description
    int length

    The length of the source.

    int rangeMaxLength

    The maximum size of the resulting chunks.

    int stride

    The stride controls how the generator goes along the length of the source.

    Output<Range> output

    The sequence of chunks, each represented by a Range.

    Returns
    Type Description
    int

    The number of ranges generated.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException
    • length is not positive or 0.
    • rangeMaxLength is not positive or 0.
    • stride lowe than 0 or higher than rangeMaxLength.

    GetRangesInternal(int, int, int, Output<Range>)

    Generates a sequence of chunks based on the length of the source, the maximum size of those chunks, and a stride.

    Declaration
    protected abstract int GetRangesInternal(int length, int rangeMaxLength, int stride, Output<Range> output)
    Parameters
    Type Name Description
    int length

    The length of the source.

    int rangeMaxLength

    The maximum size of the resulting chunks.

    int stride

    The stride controls how the generator goes along the length of the source.

    Output<Range> output

    The sequence of chunks, each represented by a Range.

    Returns
    Type Description
    int

    The number of ranges generated.

    Implements

    IRangeGenerator
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)