Pretty new to python and pytorch. Super basic question…
Per code below
class Perceptron(nn.Module):
  def __init__(self,input_dim):
    super(Perceptron,self).__init__()
    self.fc1 = nn.Linear(input_dim,1)

  def forward(self, x_in):
    return torch.sigmoid(self.fc1(x_in)).squeeze()

p1 = Perceptron(3)
x = torch.randn((5,3))
torch.equal(p1.fc1.forward(x),p1.fc1(x))

result is “True”.
Looked at the source code and couldn’t figure out why

I can run p1.fc1(x) directly
why it defaults to run forward()

Thank you!!!