(rontolisp) docs
← Functions

linalg:transpose

(linalg:transpose array &optional axes)

Returns the transpose of a matrix: element (i j) of the result is element (j i) of the input. Like numpy, a rank-1 vector is returned unchanged -- there is no distinct row/column vector representation. To turn a vector into a genuine 1-row or 1-column matrix, use linalg:reshape.

With an axes list (numpy's x.transpose(0, 3, 1, 2)), returns the rank-n axis permutation instead: axis k of the result is axis (nth k axes) of the input, so the result's shape is the input's shape reindexed by axes. The list must name each of the input's axes exactly once.