dpnp.tensor.squeeze¶
- dpnp.tensor.squeeze(X, /, axis=None)[source]¶
Removes singleton dimensions (axes) from array x.
- Parameters:
x (usm_ndarray) -- Input array.
axis ({None, int, tuple of ints}, optional) --
Axis (or axes) to squeeze.
Default:
None.
- Returns:
out -- Output array is a view, if possible, and a copy otherwise, but with all or a subset of the dimensions of length 1 removed. Output has the same data type as the input, is allocated on the same device as the input and has the same USM allocation type as the input array x.
- Return type:
- Raises:
ValueError -- If the specified axis has a size greater than one.