A lot of the PyTorch tutorials I've been viewing do something like this.
Define model:
class Network(nn.Module):
def __init__():
super().__init__()
self.conv1 = ..
...
def forward(x)
...
...
Once the Network has been instantiated (net = Network()), the people in the tutorials write net(input_data) instead of net.forward(input_data).
I tried net.forward() and it gives the same results as net().
Why is this a common practice, and also why does this work?