diff --git a/learning-pytorch/tensor_tutorial.py b/learning-pytorch/tensor_tutorial.py index af403f9..d0b6e9b 100755 --- a/learning-pytorch/tensor_tutorial.py +++ b/learning-pytorch/tensor_tutorial.py @@ -21,7 +21,14 @@ import torch # print(x[:, 1]) -x = torch.randn(4, 4) -y = x.view(16) -z = x.view(-1, 8) # the size -1 is inferred from other dimensions -print(x.size(), y.size(), z.size()) +# x = torch.randn(4, 4) +# y = x.view(16) +# z = x.view(-1, 8) # the size -1 is inferred from other dimensions +# print(x.size(), y.size(), z.size()) + +x = torch.randn(1) +print(x) +print(x.item()) + +a = torch.ones(5) +print(a)