Class LeftPadding
Pads the sequences of tokens by adding tokens to the left.
Implements
Inherited Members
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 | Computes the target length of the padded sequences. |
| Token | padToken | The token to use to pad a sequence of token. |
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. |