Handbook
Glossary
check-vstack-shape ( seq -- seq )
Vocabulary
tensors
.
private
Inputs
seq
an
object
Outputs
seq
an
object
Definition
USING:
accessors
kernel
math
sequences
tensors
;
IN:
tensors.private
::
check-vstack-shape
( seq -- seq )
seq
first
{
}
>tensor
dup
:>
empty-tensor
like
shape>>
dup
:>
first-shape
length
2
-
:>
vdim seq
[
empty-tensor
like
dup
shape>>
first-shape
[
=
]
2map
vdim
swap
remove-nth
t
[
=
]
reduce
[
shape>>
first-shape
swap
shape-mismatch-error
]
unless
]
map
;