Parameters are designed to be leaf nodes in PyTorch. You should not backpropagate parameters. And you are right, modifying .data of a tensor does not produce a grad_fn.
You can use customized layers with backpropagatable “parameters”. An example is https://github.com/dragen1860/MAML-Pytorch 90
Personally， I suggest you to use my lib https://github.com/yhqjohn/MetaNN， 47 and use dependents() instead of parameters().