Handbook
Glossary
shaped-transpose ( array -- view )
NumPy-style shaped-array operations
Prev:
shaped-permute ( array axes -- view )
Next:
shaped-sum ( array axes keepdims? -- result )
Vocabulary
arrays
.
shaped
Inputs
array
a
shaped-array
, a
sequence
, or a
number
Outputs
view
a
shaped-array
Word description
Returns a writable view with the axis order reversed. For two dimensions this is a matrix transpose; for zero or one dimension the shape is unchanged.
Definition
USING:
kernel
sequences
;
IN:
arrays.shaped
:
shaped-transpose
( array -- view )
>shaped-array
dup
ndim
<iota>
reverse
shaped-permute
;