DeepLearningDTU / 02456-deep-learning-with-PyTorch

Exercises and supplementary material for the deep learning course 02456 using PyTorch.
313 stars 455 forks source link

Mistake in 1.2-automatic-differentiation.ipynb #1

Open cgoecknerwald opened 6 years ago

cgoecknerwald commented 6 years ago

Text in notebook:

z.sum().backward() print(x.grad) tensor([[27., 27.], [27., 27.]])

It says "You should have got a matrix of 4.5." This code actually creates

tensor([[27., 27.], [27., 27.]])

It looks like it should instead be:

z.sum() print(x.grad)