PacktPublishing / Deep-Learning-with-PyTorch

Deep Learning with PyTorch, published by Packt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ch02 Page 21

ghufransyed opened this issue · comments

This refers to the book, not the notebook

The example for scalar should read:

x = torch.rand(1)
x.size()

Output - torch.Size([1])


it currently reads "torch.rand(10)" which gives a 1-D tensor (a vector), not a 0-D tensor (scalar)