Class DirectionalPaddingBase
Base type for directional padding processor.
Implements
Inherited Members
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 |
|
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. |