tf.stack

Stacks a list of rank-R tensors into one rank-(R+1) tensor.

Used in the notebooks

Used in the guide Used in the tutorials

See also tf.concat, tf.tile, tf.repeat.

Packs the list of tensors in values into a tensor with rank one higher than each tensor in values, by packing them along the axis dimension. Given a list of length N of tensors of shape (A, B, C);

if axis == 0 then the output tensor will have the shape (N, A, B, C). if axis == 1 then the output tensor will have the shape (A, N, B, C). Etc.

For example:

x = tf.constant([1, 4])
y = tf.constant([2, 5])