T
- data type for output()
output@Operator public final class Unstack<T> extends PrimitiveOp implements Iterable<Operand<T>>
Unpacks `num` tensors from `value` by chipping it along the `axis` dimension. For example, given a tensor of shape `(A, B, C, D)`;
If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]` and each tensor in `output` will have shape `(B, C, D)`. (Note that the dimension unpacked along is gone, unlike `split`).
If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]` and each tensor in `output` will have shape `(A, C, D)`. Etc.
This is the opposite of `pack`.
Modifier and Type | Class and Description |
---|---|
static class |
Unstack.Options
Optional attributes for
Unstack |
operation
Modifier and Type | Method and Description |
---|---|
static Unstack.Options |
axis(Long axis) |
static <T> Unstack<T> |
create(Scope scope,
Operand<T> value,
Long num,
Unstack.Options... options)
Factory method to create a class wrapping a new Unstack operation.
|
Iterator<Operand<T>> |
iterator() |
List<Output<T>> |
output()
The list of tensors unpacked from `value`.
|
equals, hashCode, op, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static <T> Unstack<T> create(Scope scope, Operand<T> value, Long num, Unstack.Options... options)
scope
- current scopevalue
- 1-D or higher, with `axis` dimension size equal to `num`.num
- options
- carries optional attributes valuespublic static Unstack.Options axis(Long axis)
axis
- Dimension along which to unpack. Negative values wrap around, so the
valid range is `[-R, R)`.Copyright © 2022. All rights reserved.