Performs the element-wise division of tensor1 by tensor2,
multiplies the result by the scalar value and adds it to input.
outi=inputi+value×tensor2itensor1i For inputs of type FloatTensor or DoubleTensor, value must be
a real number, otherwise an integer.
- Parameters:
input (Tensor) – the tensor to be added
tensor1 (Tensor) – the numerator tensor
tensor2 (Tensor) – the denominator tensor
- Keyword Arguments:
value (Number, optional) – multiplier for tensor1/tensor2
out (Tensor, optional) – the output tensor.
t = torch.randn(1, 3)
t1 = torch.randn(3, 1)
t2 = torch.randn(1, 3)
torch.addcdiv(t, t1, t2, value=0.1)
tensor([[-0.2312, -3.6496, 0.1312],
[-1.0428, 3.4292, -0.1030],
[-0.5369, -0.9829, 0.0430]])