Hi,
Firstly let me say it would be nice if You could format all of your code, including init method.
Also, it would be helpful if You could provide a working example of how to replicate the error (the code doesn’t run)
Nevertheless, your error is caused by the fact that you don’t call Module class __init__. Your code should be:
class Loss(torch.nn.Module):
    def __init__(self):
        super(torch.nn.Module, self).__init__()

        ... # rest of the __init__ here