dpnp.shape

dpnp.shape(a)[source]

Return the shape of an array.

For full documentation refer to numpy.shape.

Parameters:

a (array_like) -- Input array.

Returns:

shape -- The elements of the shape tuple give the lengths of the corresponding array dimensions.

Return type:

tuple of integers

See also

len

len(a) is equivalent to np.shape(a)[0] for N-D arrays with N>=1.

dpnp.ndarray.shape

Equivalent array method.

Examples

>>> import dpnp as dp
>>> dp.shape(dp.eye(3))
(3, 3)
>>> dp.shape([[1, 3]])
(1, 2)
>>> dp.shape([0])
(1,)
>>> dp.shape(0)
()