To make sure the computation graph is not detached anymore you could check the .grad attribute of model parameters before and after the first loss.backward() call.
Before it, .grad should return None (as no gradients were computed yet), and afterwards it should show a valid tensor.