[Solved] What is the correct way to implement custom loss function?

It is perhaps too late but for static class you should not make an instance by LSE_loss() instead you should call apply:

loss = LSE_loss.apply

3 Likes