squeezeΒΆ
- squeeze(x: array, /, axis: int | Tuple[int, ...]) array ΒΆ
Removes singleton dimensions (axes) from
x
.- Parameters:
x (array) β input array.
axis (Union[int, Tuple[int, ...]]) β axis (or axes) to squeeze.
- Returns:
out (array) β an output array having the same data type and elements as
x
.- Raises:
ValueError β If a specified axis has a size greater than one (i.e., it is not a singleton dimension), a
ValueError
should be raised.