From 2e26abe099721b5647d145906874cbdbf886e589 Mon Sep 17 00:00:00 2001 From: Vinh Khuc Date: Sun, 12 Feb 2017 22:22:52 -0800 Subject: [PATCH] Tensor multiplication --- 0_multiply.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 0_multiply.py diff --git a/0_multiply.py b/0_multiply.py new file mode 100644 index 0000000..00cb18d --- /dev/null +++ b/0_multiply.py @@ -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]