Skip to content

Shape Ops ​

shape_ops.concat ​

tensor.concat — join a non-empty list of same-rank tensors along

axis, which must agree on every other axis and whose extents sum. Row-major: dims before axis give an outer repeat count, dims after an inner contiguous run — each input's per-outer block is contiguous, copied block-by-block (the host impl's loop order).

Signature: shape_ops.concat((xs, axis))

shape_ops.concat_backward ​

tensor.concat_backward — g split back along axis at each

input's extent (mirrors ConcatBackward): per input, the odometer maps its coordinates into g with the cumulative axis offset.

Signature: shape_ops.concat_backward((xs, axis, g))

shape_ops.reshape ​

tensor.reshape — re-label the flat row-major payload under

shape; the extents' product must equal the element count (a reshape is a view, not a permutation — the data order never moves). No -1 wildcard, matching the host op.

Signature: shape_ops.reshape((t, shape))

shape_ops.reshape_backward ​

tensor.reshape_backward — g relabeled back to the input's shape

(a reshape moves no data; mirrors ReshapeBackward).

Signature: shape_ops.reshape_backward((t, sh, g))

shape_ops.transpose ​

tensor.transpose — swap axes d0/d1: the output's axis d

reads the input's axis perm[d]. d0 == d1 is the identity; an out-of-range axis is an error. The output is produced in its own row-major order, each index tuple mapped back through the permuted input strides.

Signature: shape_ops.transpose((t, d0, d1))

shape_ops.transpose_backward ​

tensor.transpose_backward — g transposed along the same axes

(transpose is self-inverse; mirrors TransposeBackward).

Signature: shape_ops.transpose_backward((t, d0, d1, g))