I need to define a class Model
that contains my model parameters, but for which it makes no sense to define a forward
method. Instead, I’ll define other modules which can read the parameters from Model
and which then define their forward
methods.
Is it natural that Model
inherits from Module
in this case (even though it doesn’t implement forward
)?
Inheriting from Module
helps, because it means that the parameters are tracked automatically and I can compose several Model
components together easily.
What do you think?