Handbook
Glossary
2d-matmul ( vec1: float-array vec2: float-array res: float-array m: fixnum n: fixnum p: fixnum -- )
Vocabulary
tensors
.
private
Inputs
vec1
a
float-array
vec2
a
float-array
res
a
float-array
m
a
fixnum
n
a
fixnum
p
a
fixnum
Outputs
None
Definition
USING:
accessors
kernel
math
sequences
sequences.private
typed
;
IN:
tensors.private
TYPED::
2d-matmul
( vec1: float-array vec2: float-array res: float-array m: fixnum n: fixnum p: fixnum -- )
{
n p
}
vec2
<tensor>
2d-transpose
vec>>
:>
vec2 m
[
:>
i i n
*
:>
in i p
*
:>
ip vec1 in n
make-subseq
p
[
:>
j
dup
vec2 j n
*
n
make-subseq
0.0
[
*
+
]
2reduce
ip j
+
res
set-nth-unsafe
]
each-integer
drop
]
each-integer
;