Handbook
Glossary
check-matmul-shape ( tensor1 tensor2 -- )
Vocabulary
tensors
.
private
Inputs
tensor1
an
object
tensor2
an
object
Outputs
None
Definition
USING:
accessors
kernel
locals.backend
math
sequences
tensors
;
IN:
tensors.private
:
check-matmul-shape
( tensor1 tensor2 -- )
[
shape>>
]
bi@
load-local
load-local
0
get-local
last
-1
get-local
[
length
2
-
]
keep
nth
=
0
get-local
2
head*
-1
get-local
2
head*
=
and
0
get-local
-1
get-local
[
2
load-locals
-1
get-local
0
get-local
shape-mismatch-error
2
drop-locals
]
curry
curry
unless
2
drop-locals
;