mm.math.squeeze

math.squeeze(axis)

Removes dimensions of size 1 from the shape of a tensor.

Parameters:
  • tensor (Tensor) – the tensor to squeeze

  • axis (Optional[List[int]]) – if specified, only squeezes the dimensions listed, defaults to []

Returns:

tensor with one or more dimensions of size 1 removed

Return type:

Tensor