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 tonp.shape(a)[0]
for N-D arrays withN>=1
.dpnp.ndarray.shape
Equivalent array method.
Examples
>>> import dpnp as np >>> np.shape(np.eye(3)) (3, 3) >>> np.shape([[1, 3]]) (1, 2) >>> np.shape([0]) (1,) >>> np.shape(0) ()