docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LeftPadding

    Pads the sequences of tokens by adding tokens to the left.

    Inheritance
    object
    DirectionalPaddingBase
    LeftPadding
    Implements
    IPadding
    Inherited Members
    DirectionalPaddingBase.PadToken
    DirectionalPaddingBase.PadToMultipleOf
    DirectionalPaddingBase.Pad(IReadOnlyList<IReadOnlyList<Token>>, Output<IEnumerable<Token>>)
    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 class LeftPadding : DirectionalPaddingBase, IPadding

    Constructors

    LeftPadding(IPaddingSizeProvider, Token)

    Initializes a new instance of the LeftPadding type.

    Declaration
    public LeftPadding(IPaddingSizeProvider paddingSizeProvider, Token padToken)
    Parameters
    Type Name Description
    IPaddingSizeProvider paddingSizeProvider

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

    Token padToken

    The token to use to pad a sequence of tokens.

    LeftPadding(IPaddingSizeProvider, Token, int)

    Initializes a new instance of the LeftPadding type.

    Declaration
    public LeftPadding(IPaddingSizeProvider paddingSizeProvider, Token padToken, int padToMultipleOf = 1)
    Parameters
    Type Name Description
    IPaddingSizeProvider paddingSizeProvider

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

    Token padToken

    The token to use to pad a sequence of tokens.

    int padToMultipleOf

    Sets the pad length to the upper multiple of this value.

    Methods

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

    Pads the input sequence of tokens to reach the padSize.

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

    The target size.

    Output<Token> output

    Recipient of padded tokens.

    Overrides
    DirectionalPaddingBase.PadSequence(IReadOnlyList<Token>, int, Output<Token>)

    Implements

    IPadding
    In This Article
    Back to top
    Copyright © 2026 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)