chainerx.squeeze

chainerx.squeeze(a, axis=None)

Removes size-one axes from the shape of an array.

Parameters
  • a (ndarray) – Array to be reshaped.

  • axis (int or tuple of ints) – Axes to be removed. This function removes all size-one axes by default. If one of the specified axes is not of size one, an exception is raised.

Returns

An array without (specified) size-one axes.

Return type

ndarray

Note

During backpropagation, this function propagates the gradient of the output array to the input array a.

See also

numpy.squeeze()