cupy.size#

cupy.size(ndarray a, axis=None) Py_ssize_t#

Returns the number of elements along a given axis.

Parameters:
  • a (ndarray) – Input data.

  • axis (int or None) – Axis along which the elements are counted. When it is None, it returns the total number of elements.

Returns:

Number of elements along the given axis.

Return type:

int