The .grad attribute of a Tensor that is not a leaf Tensor is being accessed.
Its .grad attribute won’t be populated during autograd.backward().
If you indeed want the gradient for a non-leaf Tensor, use .retain_grad() on the non-leaf Tensor.
If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead.
my code working well, after many iteration and epoch, but suddenlly i got above warnning, i think the code worked,
Im predict that problem because this
"If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. "
why this happen? why suddenlly access ?  because the code working well after many epoch and iteration?
what wrong and i should do?