Multiplication between two tensors is supported with the *
operators. The result of the multiplication
depends on the sizes of the tensors.
A tensor might also be multiplied by a scalar. The scalar might be on the right or left of the operator.
Examples:
> M = torch.Tensor(2,2):fill(2) > N = torch.Tensor(2,4):fill(3) > x = torch.Tensor(2):fill(4) > y = torch.Tensor(2):fill(5) > = x*y -- dot product 40 > = M*x --- matrix-vector 16 16 [torch.Tensor of dimension 2] > = M*N -- matrix-matrix 12 12 12 12 12 12 12 12 [torch.Tensor of dimension 2x4]