I have made a one layer network. I have model’s linear.weight and linear.bias in a dictionary, and I have passed the dictionary to the new nn.module class I have made. I have to find the gradient of loss wrt theta which I have multiplied with the model’s parameter. But the error is coming like “One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior”. Please help me with this so that the computation graph is maintained.
Thanks in advance