Equana

Back to NDArray Operations

size

Shape of the array. With dim, returns the size along that axis.

Syntax

size(a: NDArray) → r

Backends

TypeScriptnumwa

Description

Shape of the array. With dim, returns the size along that axis.

Parameters

NameDescription
aInput array

Returns

Tuple of dimension sizes, or a single Int64 when dim is given

Examples

Try It
>> size([1, 2, 3])
(3,)
Try It
>> size(reshape([1,2,3,4], 2, 2), 1)
2

Other Overloads