Tuple of array dimensions.
array
NdArray::shape
A 1-dim array
use SciPhp\NumPhp as np;
$m = np::linspace(1, 9, 9)->reshape(3, 3);
$shape = np::ar($m->shape);
echo "m\n$m", "shape=$shape\n";
The above example will output:
m [[1 2 3] [4 5 6] [7 8 9]] shape=[3 3]
use SciPhp\NumPhp as np;
$m = np::ar([1, 2, 3, 4]);
$m->shape = [2, 2];
echo "m\n$m";
The above example will output:
m [[1 2] [3 4]]