openvino.runtime.opset5.unsqueeze

openvino.runtime.opset5.unsqueeze(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 unsqueeze operation on input tensor.

Insert single-dimensional entries to the shape of a tensor. Takes one required argument axes, a list of dimensions that will be inserted. Dimension indices in axes are as seen in the output tensor.

For example: Inputs: tensor with shape [3, 4, 5], axes=[0, 4]

Result: tensor with shape [1, 3, 4, 5, 1]

Parameters
  • data – The node with data tensor.

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

Returns

The new node performing an unsqueeze operation on input tensor.