Solved by bit_comedian in post #2 
              
              
                I figured out, how to do this. 
just add at initialization of model 
self.ups = nn.Upsample(28)

and change forward as 
    def forward(self, x):
        x1 = self.midlevel_feature_extractor(x) #midlevel features
        x2 = self.global_feature_extractor(x) #global features
        x2 = x2.view(x2.…