You should probably try what the Error says.
gradients = torch.autograd.grad(outputs=prob_interpolated, inputs=interpolated,
                                        grad_outputs=torch.ones(prob_interpolated.size()).cuda(),
                                        create_graph=True, retain_graph=True, allow_unused=True) 

From documentation
allow_unused (bool, optional) – If False, specifying inputs that were not used when computing outputs (and therefore their grad is always zero) is an error. Defaults to False.
https://pytorch.org/docs/stable/autograd.html#torch.autograd.grad 141