openvino.runtime.opset2.squeeze

openvino.runtime.opset2.squeeze(data: Union[openvino._pyopenvino.Node, int, float, numpy.ndarray], axes: Union[openvino._pyopenvino.Node, int, float, numpy.ndarray], name: Optional[str] = None) openvino._pyopenvino.Node

Perform squeeze operation on input tensor.

Parameters
  • data – The node with data tensor.

  • axes – List of non-negative integers, indicate the dimensions to squeeze. One of: input node or array.

  • name – Optional new name for output node.

Returns

The new node performing a squeeze operation on input tensor.

Remove single-dimensional entries from the shape of a tensor. Takes a parameter axes with a list of axes to squeeze. If axes is not provided, all the single dimensions will be removed from the shape. If an axis is selected with shape entry not equal to one, an error is raised.

For example:

Inputs: tensor with shape [1, 2, 1, 3, 1, 1], axes=[2, 4]

Result: tensor with shape [1, 2, 3, 1]