The print statement is inside the ‘forward’ function. However, you need to call the function to see the result. You call the function as given above:
x = torch.randn(1, 784)
model = FirstNN()
out = model(x)  #This makes a call to forward