Example #1
0
def _squeeze_(self, dim=None):
    """Inplace of ``Tensor.squeeze()``

    Parameters
    ----------
    dim : int
        The optional dim to remove.

    Returns
    -------
    vm.torch.Tensor
        The self.

    """
    return squeeze(self, dim=dim, out=self)
Example #2
0
def _squeeze(self, dim=None):
    """Returns a tensor with all the dimensions of input of size 1 removed.

    Parameters
    ----------
    dim : int
        The optional dim to remove.


    Returns
    -------
    vm.torch.Tensor
        The new tensor.

    """
    return squeeze(self, dim=dim)