Handbook
Glossary
2d-transpose ( tensor: tensor -- tensor': tensor )
Vocabulary
tensors
.
private
Inputs
tensor
a
tensor
Outputs
tensor'
a
tensor
Definition
USING:
accessors
kernel
math
sequences
sequences.private
specialized-arrays.instances.alien.c-types.float
typed
;
IN:
tensors.private
TYPED::
2d-transpose
( tensor: tensor -- tensor': tensor )
tensor
shape>>
:>
old-shape tensor
vec>>
:>
vec old-shape
first2
:>
( s1 s2 ) old-shape
reverse
dup
product
<iota>
[
s1
/mod
s2
*
[
s2
/mod
]
dip
+
nip
vec
nth-unsafe
]
float-array{
}
map-as
<tensor>
;