Great! That was very useful. Thank you!
So, let me see if I understand (I am kind of new in PyTorch), I need to do Mass_and_v(nn.Module) when I define that class. Also, I need to change the line self.parameter = param for self.parameter = nn.Parameter(data=param, requires_grad=True). Is that right? Well, If I do this, now I get:
AttributeError: cannot assign parameters before Module.init() call
Apart from all of these, do you suggest that I have to code the Mass_and_v class all based in PyTorch, not using numpy?