Skip to content

Commit

Permalink
Tensor multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhkhuc committed Feb 13, 2017
1 parent 6cc505c commit 2e26abe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 0_multiply.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import torch

a = torch.IntTensor([2, 3, 4])
b = torch.IntTensor([3, 4, 5])
m = a * b # element-wise product
print(m.numpy()) # convert to the numpy array [ 6 12 20]

0 comments on commit 2e26abe

Please sign in to comment.