I am going through Udacity's Intro To Deep Learning with Pytorch course In the Neural Network part the instructor says that "in the init method, we need to call super, we need to do that because then PyTorch will know to register all the different layers and operation, if you don't do this part it wont be able to track the things that you are adding to your network and it wont work". Could you kindly elaborate and explain what exactly is the role of super keyword here and what does nn.Module inherits which helps in "keeping track" of changes.
Further the Jupyter notebooks says the following about use of super,
class Network(nn.Module):
Here we're inheriting from
nn.Module
. Combined withsuper().__init__()
this creates a class that tracks the architecture and provides a lot of useful methods and attributes. It is mandatory to inherit fromnn.Module
when you're creating a class for your network. The name of the class itself can be anything.