src/transformers/models/resnet/modeling_resnet.py/ResNetBackbone/__init__
class ResNetBackbone:    def __init__(self, config):
        super().__init__(config)

        self.stage_names = config.stage_names
        self.embedder = ResNetEmbeddings(config)
        self.encoder = ResNetEncoder(config)

        self.out_features = config.out_features if config.out_features is not None else [self.stage_names[-1]]

        out_feature_channels = {}
        out_feature_channels["stem"] = config.embedding_size
        for idx, stage in enumerate(self.stage_names[1:]):
            out_feature_channels[stage] = config.hidden_sizes[idx]

        self.out_feature_channels = out_feature_channels

        # initialize weights and apply final processing
        self.post_init()