You could implement the rescaling and the usage of different code paths in the forward method of your model.
To rescale the tensor activations you could use e.g. torch.nn.functional.interpolate or an upsamling layer.