The forward function defines how to get the output of the neural net. In particular, it is called when you apply the neural net to an input Variable:
net = Net()
net(input)  # calls net.forward(input)

The view function 365 takes a Tensor and reshapes it.
In particular, here x is being resized to a matrix that is -1 by self.num_flat_features(x). The -1 isn’t actually
-1, it autoinfers the amount necessary (see docs 365)
x = x.view(-1, self.num_flat_features(x))
What this is doing here exactly is changing x to a vector with self.num_flat_features(x) elements (the size of the first dimension is inferred to be 1.)