How did you implement your class?
If you like the manual approach, you don’t need to derive a class from nn.Module and can just write the operations as you wish. An nn.Module class helps in managing the internal parameters and makes some workflows easier, e.g. pushing all parameters to the GPU by calling .to('cuda').