src/transformers/models/convnextv2/modeling_convnextv2.py/ConvNextV2GRN/forward
class ConvNextV2GRN:    def forward(self, hidden_states: torch.FloatTensor) -> torch.FloatTensor:
        # Compute and normalize global spatial feature maps
        global_features = torch.norm(hidden_states, p=2, dim=(1, 2), keepdim=True)
        norm_features = global_features / (global_features.mean(dim=-1, keepdim=True) + 1e-6)
        hidden_states = self.gamma * (hidden_states * norm_features) + self.beta + hidden_states

        return hidden_states