Thank you for your answer.
So the class basically consists of an init where I initializie the matrices as nn.Parameters to enable training and then I have a loss function where I calculate the loss using these matrices and some external input (the data). Do you think there will be any unexpected behaviour without the forward class when I inherit from nn.Module? Because I actually would like to make use of cuda since this class is only one part of a bigger model. So basically I would like to let it remain inheriting from nn.Module. Do you think this is a bad idea?