src/transformers/models/dpt/modeling_dpt.py/DPTNeck/forward
class DPTNeck:    def forward(self, hidden_states: List[torch.Tensor]) -> List[torch.Tensor]:
        if not isinstance(hidden_states, list):
            raise ValueError("hidden_states should be a list of tensors")

        if len(hidden_states) != len(self.config.neck_hidden_sizes):
            raise ValueError("The number of hidden states should be equal to the number of neck hidden sizes.")

        # postprocess hidden states
        features = self.reassemble_stage(hidden_states)

        features = [self.convs[i](feature) for i, feature in enumerate(features)]

        # fusion blocks
        output = self.fusion_stage(features)

        return output