public static final class PaddingStackBatchifier.Builder
extends java.lang.Object
PaddingStackBatchifier.| Modifier and Type | Method and Description |
|---|---|
PaddingStackBatchifier.Builder |
addPad(int array,
int dim,
NDArraySupplier supplier)
Adds a new dimension to be padded in the input
NDList. |
PaddingStackBatchifier.Builder |
addPad(int array,
int dim,
NDArraySupplier supplier,
int paddingSize)
Adds a new dimension to be padded in the input
NDList. |
PaddingStackBatchifier |
build()
Builds the
PaddingStackBatchifier. |
PaddingStackBatchifier.Builder |
optIncludeValidLengths(boolean includeValidLengths)
Sets whether to include the valid lengths (length of non-padded data) for each array.
|
public PaddingStackBatchifier.Builder optIncludeValidLengths(boolean includeValidLengths)
includeValidLengths - true to include valid lengthspublic PaddingStackBatchifier.Builder addPad(int array, int dim, NDArraySupplier supplier)
NDList.array - which array in the NDList to paddim - which dimension in the array to padsupplier - a supplier that produces the padding array. The padding array shape
should include both the batch and a 1 for the padded dimension. For batch array shape
NTC, the padding shape should be N x 1 x Cpublic PaddingStackBatchifier.Builder addPad(int array, int dim, NDArraySupplier supplier, int paddingSize)
NDList.array - which array in the NDList to paddim - which dimension in the array to padsupplier - a supplier that produces the padding array. The padding array shape
should include both the batch and a 1 for the padded dimension. For batch array shape
NTC, the padding shape should be N x 1 x CpaddingSize - the minimum padding size to use. All sequences to pad must be less
than this sizepublic PaddingStackBatchifier build()
PaddingStackBatchifier.PaddingStackBatchifier