I ma trying to connect a network (say net) at the front of pretrained network. I am trying to add a custom layer in my net. The ouput of this custom layer will go through the pre-trained network and the loss will be back-propagated. For doing this I wrote a custom training loop. But when I run my code, an error pops up saying
"Custom layer with backward functions are not supported" .
Can you please help with me with how to add the custom layer when writing the custom training loop? Any pointers on this will be appreciated. Thanks