1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| a = torch.Tensor([[1,2], [4,5]])
v = torch.Tensor([[7], [8]])
d = torch.multiply(a,v) print(d)
e = a @ v print(e)
f = a * v print(f)
output: tensor([[ 7., 14.], [32., 40.]]) tensor([[23.], [68.]]) tensor([[ 7., 14.], [32., 40.]])
|