dpnp.atleast_3d

dpnp.atleast_3d(*arys)[source]

View inputs as arrays with at least three dimensions.

For full documentation refer to numpy.atleast_3d.

Parameters:

arys ({dpnp.ndarray, usm_ndarray}) -- One or more array-like sequences. Arrays that already have three or more dimensions are preserved.

Returns:

out -- An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned.

Return type:

dpnp.ndarray

See also

dpnp.atleast_1d

Convert inputs to arrays with at least one dimension.

dpnp.atleast_2d

View inputs as arrays with at least three dimensions.

Examples

>>> import dpnp as np
>>> x = np.array(3.0)
>>> np.atleast_3d(x)
array([[[3.]]])
>>> x = np.arange(3.0)
>>> np.atleast_3d(x).shape
(1, 3, 1)
>>> x = np.arange(12.0).reshape(4, 3)
>>> np.atleast_3d(x).shape
(4, 3, 1)