public final class PaddingStackBatchifier extends java.lang.Object implements Batchifier
StackBatchifier
that also pads elements to reach the
same length.Modifier and Type | Class and Description |
---|---|
static class |
PaddingStackBatchifier.Builder
Builder to build a
PaddingStackBatchifier . |
STACK
Modifier and Type | Method and Description |
---|---|
NDList |
batchify(NDList[] inputs)
Converts an array of
NDList into an NDList. |
static PaddingStackBatchifier.Builder |
builder()
Returns a
PaddingStackBatchifier.Builder . |
NDList[] |
split(NDList list,
int numOfSlices,
boolean evenSplit)
Splits the given
NDList into the given number of slices. |
NDList[] |
unbatchify(NDList inputs)
Reverses the
batchify operation. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromString
public NDList batchify(NDList[] inputs)
NDList
into an NDList.
The size of the input array is the batch size. The data in each of the NDList
are
assumed to be the same, and are batched together to form one batched NDList
.
batchify
in interface Batchifier
inputs
- the input array of NDList
where each element is aNDList
public NDList[] unbatchify(NDList inputs)
batchify
operation.unbatchify
in interface Batchifier
inputs
- the NDList
that needs to be 'unbatchified'public NDList[] split(NDList list, int numOfSlices, boolean evenSplit)
NDList
into the given number of slices.
This function unbatchifies the input NDList
, redistributes them into the given
number of slices, and then batchify each of the slices to form an array of NDList
.
split
in interface Batchifier
list
- the NDList
that needs to be splitnumOfSlices
- the number of slices the list must be sliced intoevenSplit
- whether each slice must have the same shapeNDList
that contains all the slicespublic static PaddingStackBatchifier.Builder builder()
PaddingStackBatchifier.Builder
.PaddingStackBatchifier.Builder