The backward call will free the intermediate tensors, which were needed for the gradient computation, so save memory. If you need to call backward multiple times, you would need to set retain_graph=True in the backward call:
x = torch.tensor(0.1)
w = torch.tensor(0.1,requires_grad = True)
y=x*w
z=y*w
y.backward(retain_graph=True)
z.backward(retain_graph=True)
c = y+z
c.backward()