class_docstr: GRN (Global Response Normalization) layer
class_docstr_tok: ["GRN","(","Global","Response","Normalization",")","layer"]
code: 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.weight * (hidden_states * norm_features)
          + self.bias
          + hidden_states
      )
  
      return hidden_states
  
imports: from typing import Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BackboneOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from ...utils.backbone_utils import BackboneMixin
  from .configuration_convnextv2 import ConvNextV2Config
label_desc: Use image node_id 2 for calling the ConvNextV2GRN obj's underlying member method code with example usage: obj.forward(hidden_states) and returns: hidden_states