docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class DirectionalPaddingBase

    Base type for directional padding processor.

    Inheritance
    object
    DirectionalPaddingBase
    LeftPadding
    RightPadding
    Implements
    IPadding
    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.Padding
    Assembly: Unity.InferenceEngine.Tokenization.dll
    Syntax
    public abstract class DirectionalPaddingBase : IPadding

    Constructors

    DirectionalPaddingBase(IPaddingSizeProvider, Token)

    Initializes a new instance of the DirectionalPaddingBase type.

    Declaration
    protected DirectionalPaddingBase(IPaddingSizeProvider paddingSizeProvider, Token padToken)
    Parameters
    Type Name Description
    IPaddingSizeProvider paddingSizeProvider

    When applying the padding, this object provide the final size of the padded sequence.

    Token padToken

    The token to use to pad a sequence of token.

    Exceptions
    Type Condition
    ArgumentNullException

    paddingSizeProvider cannot be null.

    Fields

    PadToken

    The token to use to fill the final sequence with.

    Declaration
    protected readonly Token PadToken
    Field Value
    Type Description
    Token

    Methods

    Pad(IReadOnlyList<IReadOnlyList<Token>>, Output<IEnumerable<Token>>)

    Apply the padding to sequences of tokens and add the result to the output.

    Declaration
    public void Pad(IReadOnlyList<IReadOnlyList<Token>> sequences, Output<IEnumerable<Token>> output)
    Parameters
    Type Name Description
    IReadOnlyList<IReadOnlyList<Token>> sequences

    The collection of sequences of tokens to pad.

    Output<IEnumerable<Token>> output

    The target container of padded sequences.

    PadSequence(IReadOnlyList<Token>, int, Output<Token>)

    Pads the input sequence of tokens to reach the padSize.

    Declaration
    protected abstract void PadSequence(IReadOnlyList<Token> input, int padSize, Output<Token> output)
    Parameters
    Type Name Description
    IReadOnlyList<Token> input

    The sequence of tokens to pad.

    int padSize

    The target size.

    Output<Token> output

    Recipient of padded tokens.

    Implements

    IPadding
    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)