Class RightPadding
Pads the sequences of tokens by adding tokens to the right.
Implements
Inherited Members
Namespace: Unity.InferenceEngine.Tokenization.Padding
Assembly: Unity.InferenceEngine.Tokenization.dll
Syntax
public class RightPadding : DirectionalPaddingBase, IPadding
Constructors
RightPadding(IPaddingSizeProvider, Token)
Initializes a new instance of the RightPadding type.
Declaration
public RightPadding(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. |
RightPadding(IPaddingSizeProvider, Token, int)
Initializes a new instance of the RightPadding type.
Declaration
public RightPadding(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>)
Applies a padding to sequences of tokens.
Declaration
protected override void PadSequence(IReadOnlyList<Token> tokens, int padSize, Output<Token> output)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<Token> | tokens | |
| int | padSize | |
| Output<Token> | output | The target container of padded sequences of tokens. |