Performs the outer-product between vec1
(1D tensor) and vec2
(1D tensor), multiply the resulting matrix
by the scalar value
and add the result to self (which must be a 2D tensor).
In other words,
self_ij = self_ij + value * vec1_i * vec2_j
If vec1
is a vector of size n
and vec2
is a vector of size m
, then self must be a matrix of size
n x m
.
> x = torch.Tensor(3) > y = torch.Tensor(2) > for i=1,3 do x[i] = i end > for i=1,2 do y[i] = i end > M = torch.Tensor(3, 2):zero() > M:addT1outT1(1, x, y) > = M 1 2 2 4 3 6 [torch.Tensor of dimension 3x2]