Exemplo n.º 1
0
def div_(self, value):
    """Inplace of ``Tensor.div()``

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, out=self, op='Div')
Exemplo n.º 2
0
def div(self, value):
    """Divide the ``self`` and ``value`` into the output tensor.

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, op='Div')
Exemplo n.º 3
0
def mul(self, value):
    """Multiply the ``self`` and ``value`` into the output tensor.

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, op='Mul')
Exemplo n.º 4
0
def sub(self, value):
    """Subtract the ``self`` and ``value`` into the output tensor.

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, op='Sub')
Exemplo n.º 5
0
def add_(self, value):
    """Inplace of ``torch.add()``

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, out=self, op='Add')
Exemplo n.º 6
0
def add(self, value):
    """See ``torch.add()``

    Parameters
    ----------
    value : vm.torch.Tensor, int or float
        The value tensor.

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

    """
    return _fundamental(self, value, op='Add')