0

Defining a deep learning model in PyTorch, I have read something similar:

class Network(torch.nn.Module):
    def __init__(self, in_channels, hidden_channels, out_channels, dropout, prop, **kwargs):
        super(Network, self).__init__()

What is not clear to me is, why in the super constructor people write the name of the class (Network in this case) itself? I would have better interpreted something like

super().__init__()

so just inheriting attributes of the parent class..

James Arten
  • 324
  • 1
  • 8
  • 1
    This has nothing to do with PyTorch but is related with Python version 2 vs version 3, see [What does 'super' do in Python? - difference between super().__init__() and explicit superclass __init__()](https://stackoverflow.com/questions/222877/what-does-super-do-in-python-difference-between-super-init-and-expl). – Ivan Oct 04 '21 at 17:26

0 Answers0