ndarray
autograd
loss
NDArray.
size
Number of elements in the array.
Equivalent to the product of the array’s dimensions.
Examples
>>> import numpy as np >>> x = mx.nd.zeros((3, 5, 2)) >>> x.size 30 >>> np.prod(x.shape) 30