When you create new_model it doesn’t know about the detailed
structure of your class Net. In particular, it doesn’t know about Net's forward() function. (It does know about model.children()).
So I don’t think any of the torch.nn.functional functions used
in model (an instance of your Net) get called when you execute new_model (data). In particular, F.max_pool2d (x, 2) isn’t
Note that the size of the output of self.conv2 is (64*3)**2 = 36864,
the second dimension of m1 in your size-mismatch error. The size of
the input to self.fc1 is 9216, the first dimension of m2. Had max_pool2d() been called it would have reduced 36864 by a factor
of 2**2 = 4, yielding 9216, eliminating the size-mismatch error.
Either build a New_Net class (of which new_model will be an
instance) with an appropriate forward function, or only use Modules
to build your Net class (and make Net an nn.Sequential). That is,
use Modules like nn.ReLU and nn.MaxPool2d instead of functions
like F.relu() and F.max_pool2d().