Unstack

public final class Unstack

Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors.

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`.

Nested Classes

class Unstack.Options Optional attributes for Unstack  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static Unstack.Options
axis(Long axis)
static <T extends TType> Unstack<T>
create(Scope scope, Operand<T> value, Long num, Options... options)
Factory method to create a class wrapping a new Unstack operation.
Iterator<Operand<T>>
List<Output<T>>
output()
The list of tensors unpacked from `value`.

Inherited Methods

org.tensorflow.op.RawOp
final boolean
equals(Object obj)
final int
Operation
op()
Return this unit of computation as a single Operation.
final String
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.op.Op
abstract ExecutionEnvironment
env()
Return the execution environment this op was created in.
abstract Operation
op()
Return this unit of computation as a single Operation.
abstract void
forEach(Consumer<? super T> arg0)
abstract Iterator<Operand<T>>
iterator()
abstract Spliterator<Operand<T>>
spliterator()

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "Unpack"

Public Methods

public static Unstack.Options axis (Long axis)

Parameters
axis Dimension along which to unpack. Negative values wrap around, so the valid range is `[-R, R)`.

public static Unstack<T> create (Scope scope, Operand<T> value, Long num, Options... options)

Factory method to create a class wrapping a new Unstack operation.

Parameters
scope current scope
value 1-D or higher, with `axis` dimension size equal to `num`.
options carries optional attributes values
Returns
  • a new instance of Unstack

public Iterator<Operand<T>> iterator ()

public List<Output<T>> output ()

The list of tensors unpacked from `value`.