Question about `Warning unrecognized nn.Module`

I tried to use the method autograd.grad to calculate the sum of gradients of outputs. But I encountered the warnings that are like Warning unrecognized nn.Module : LayerNorm, Warning unrecognized nn.Module : Identity and Warning unrecognized nn.Module : GELU.

Could anyone help me with this problem? Or show me some ideas on how to solve it.

The version of pytorch is 1.12.0.

Are you seeing the same warning in the latest stable or nightly PyTorch release?

Unfortunately, it raises the same warning in the 2.0.1+cu118.

Is there any being method which could solve this warning? I will get a wrong explaing becasue of uncorrect gradient. :sob: