src/transformers/models/dpt/modeling_dpt.py/DPTReassembleLayer/__init__
class DPTReassembleLayer:    def __init__(self, config, channels, factor):
        super().__init__()
        # projection
        self.projection = nn.Conv2d(in_channels=config.hidden_size, out_channels=channels, kernel_size=1)

        # up/down sampling depending on factor
        if factor > 1:
            self.resize = nn.ConvTranspose2d(channels, channels, kernel_size=factor, stride=factor, padding=0)
        elif factor == 1:
            self.resize = nn.Identity()
        elif factor < 1:
            # so should downsample
            self.resize = nn.Conv2d(channels, channels, kernel_size=3, stride=int(1 / factor), padding=1)