class_docstr: The class for PANet head.
  
  Args:
      in_channels (list[int]): A list of 4 numbers of input channels.
      hidden_dim (int): The hidden dimension of the first convolutional
          layer.
      out_channel (int): Number of output channels.
      module_loss (dict): Configuration dictionary for loss type. Defaults
          to dict(type='PANModuleLoss')
      postprocessor (dict): Config of postprocessor for PANet. Defaults to
          dict(type='PANPostprocessor', text_repr_type='poly').
      init_cfg (list[dict]): Initialization configs. Defaults to
          [dict(type='Normal', mean=0, std=0.01, layer='Conv2d'),
           dict(type='Constant', val=1, bias=0, layer='BN')]
docstr: PAN head forward.
  Args:
      inputs (list[Tensor] | Tensor): Each tensor has the shape of
          :math:`(N, C_i, W, H)`, where :math:`\sum_iC_i=C_{in}` and
          :math:`C_{in}` is ``input_channels``.
      data_samples (list[TextDetDataSample], optional): A list of data
          samples. Defaults to None.
  
  Returns:
      Tensor: A tensor of shape :math:`(N, C_{out}, W, H)` where
      :math:`C_{out}` is ``output_channels``.
docstr_tok: ["PAN","head","forward",".","Args",":","inputs","(","list","[","Tensor","]","|","Tensor",")",":","Each","tensor","has","the","shape","of",":","math",":","`","(","N",",","C_i",",","W",",","H",")","`",",","where",":","math",":","`","\\sum_iC_i=C_","{","in","}","`","and",":","math",":","`","C_","{","in","}","`","is","``","input_channels","``",".","data_samples","(","list","[","TextDetDataSample","]",",","optional",")",":","A","list","of","data","samples",".","Defaults","to","None",".","Returns",":","Tensor",":","A","tensor","of","shape",":","math",":","`","(","N",",","C_","{","out","}",",","W",",","H",")","`","where",":","math",":","`","C_","{","out","}","`","is","``","output_channels","``","."]
code: def forward(
      self,
      inputs: torch.Tensor,
      data_samples: Optional[List[TextDetDataSample]] = None,
  ) -> torch.Tensor:
      r"""PAN head forward.
      Args:
          inputs (list[Tensor] | Tensor): Each tensor has the shape of
              :math:`(N, C_i, W, H)`, where :math:`\sum_iC_i=C_{in}` and
              :math:`C_{in}` is ``input_channels``.
          data_samples (list[TextDetDataSample], optional): A list of data
              samples. Defaults to None.
  
      Returns:
          Tensor: A tensor of shape :math:`(N, C_{out}, W, H)` where
          :math:`C_{out}` is ``output_channels``.
      """
      if isinstance(inputs, tuple):
          outputs = torch.cat(inputs, dim=1)
      else:
          outputs = inputs
      outputs = self.conv1(outputs)
      outputs = self.relu1(self.bn1(outputs))
      outputs = self.conv2(outputs)
      return outputs
  
file_path: mmocr/mmocr/models/textdet/heads/pan_head.py
imports: from typing import List, Optional
  import torch
  import torch.nn
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import check_argument
  from .base import BaseTextDetHead
label_desc: Use image node_id 2 for calling the PANHead obj's underlying member method code with example usage: obj.forward(inputs, data_samples) and returns: outputs