src/transformers/models/swinv2/modeling_swinv2.py/Swinv2ForImageClassification/__init__
class Swinv2ForImageClassification:    def __init__(self, config):
        super().__init__(config)

        self.num_labels = config.num_labels
        self.swinv2 = Swinv2Model(config)

        # Classifier head
        self.classifier = (
            nn.Linear(self.swinv2.num_features, config.num_labels) if config.num_labels > 0 else nn.Identity()
        )

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