Handbook
Glossary
>shaped-array ( array -- shaped-array )
NumPy-style shaped-array operations
Next:
reshape ( array shape -- result )
Vocabulary
arrays
.
shaped
Inputs
array
a
shaped-array
, a
sequence
, or a
number
Outputs
shaped-array
a
shaped-array
Word description
Converts a rectangular nested sequence to flat row-major storage. A number becomes a zero-rank array with one element. A shaped array is returned unchanged.
Definition
IN:
arrays.shaped
GENERIC:
>shaped-array
( array -- shaped-array )
Methods
USING:
arrays
arrays.shaped
math
;
M:
number
>shaped-array
1array
{
}
<shaped-array>
;
USING:
arrays.shaped
kernel
sequences
sequences.deep
;
M:
sequence
>shaped-array
[
{
}
flatten-as
]
[
shape
]
bi
<shaped-array>
;
USING:
arrays.shaped
;
M:
shaped-array
>shaped-array
;