I can’t do that because I’m doing a static analysis of the code using astroid.
For losses, there is actually a couple of attributes that could differentiate them from the other classes

class Net(nn.Module):
    # define nn
    def __init__(self):
        super(Net, self).__init__()
        self.fc1 = nn.Linear(4, 100)
        self.fc2 = nn.Linear(100, 100)
        self.fc3 = nn.Linear(100, 3)
        self.softmax = nn.Softmax(dim=1)
​
    def forward(self, x):
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        x = self.fc3(x)
        x = self.softmax(x)
        return x

net = Net()
criterion = nn.CrossEntropyLoss()
set(dir(criterion)) - set(dir(net))

>>> {'__constants__', 'ignore_index', 'reduction', 'weight'}

What are all the other things that should inherit from torch.nn.Module?