No, Autograd knows how to propagate the gradients through squeeze. The ones are expected or which values would you expect when squeezing/unsqueezing a dimension with the size of 1?



 gphilip:

Also, what would be a good resource for getting a fairly complete picture of PyTorch autograd? The current picture I have in my head is a mish-mash of graph, leaves, detach, … which is hit-or-miss when it comes to slightly non-trivial scenarios.


This tutorial 1 might be a good starter.