Re-arrange the layout of the values within a Tensor. There is a method version of this static function: Tensor.transpose.
The total number of elements of the tensor does not change.
const t = sm.rand([128, 8]) // equivalent calls const a = t.transpose([1, 0]) a.shape // [8, 128] const b = sm.transpose(t, [1, 0]) b.shape // [8, 128]
A new Tensor
Tensor to transpose
The new order of the indices of the current axes after tranposing
Generated using TypeDoc
Re-arrange the layout of the values within a Tensor. There is a method version of this static function: Tensor.transpose.
Remarks
The total number of elements of the tensor does not change.
Example
Returns
A new Tensor