torch.ger¶
-
torch.
ger
(input, vec2, out=None) → Tensor¶ Outer product of
input
andvec2
. Ifinput
is a vector of size andvec2
is a vector of size , thenout
must be a matrix of size .Note
This function does not broadcast.
- Parameters
Example:
>>> v1 = torch.arange(1., 5.) >>> v2 = torch.arange(1., 4.) >>> torch.ger(v1, v2) tensor([[ 1., 2., 3.], [ 2., 4., 6.], [ 3., 6., 9.], [ 4., 8., 12.]])