Hello to all,
Suppose I have defined my model as a standard class that inherits torch.nn.Module.
I was wondering if it is possible to encapsulate the training routine of my model as a function of this class and to
perform training by creating a model object and then calling the relevant function
In other words, is the following possible (or good practice)?
class MyModel(torch.nn.Module):
    def __init__():
        blah

    def __forward__():
        blah

    def fit(num_epochs):
    """ Perform training for a number of epochs """
        blah

my_model = MyModel()
my_model.fit()

Thanks a lot