In that case, I would just implement the forward method, since I assume your current loss function is probably doing the same the forward would do.
If you implement the forward method, you can call the module directly (my_module(data)), it will work inside an nn.Sequential module, and all hooks will be registered properly.
I’m not sure, if there are any significant differenced between your custom loss function and what forward would do.