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.