Hi,
y.backward() will perform backprop to compute the gradients for all the leaf Tensors used to compute y.
The .grad attribute of leaf Tensors is where these computed gradients are stored.
The 60min Blitz on pytorch here 155 and the part on autograd describes this in details.