Thank you for the quick response! It works now! But I cant  make the second one work, when I do
a = Variable(torch.randn(4) + 10)
b = Variable(torch.randn(4) + 10)
loss = GammaLossMod()
print(loss(a, b))

It raises super() argument 1 must be type, not GammaLossMod, which is bizarre since i’m using python 3.5.2