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')]
code: def __init__(
      self,
      in_channels: List[int],
      hidden_dim: int,
      out_channel: int,
      module_loss=dict(type="PANModuleLoss"),
      postprocessor=dict(
          type="PANPostprocessor", text_repr_type="poly"
      ),
      init_cfg=[
          dict(type="Normal", mean=0, std=0.01, layer="Conv2d"),
          dict(type="Constant", val=1, bias=0, layer="BN"),
      ],
  ) -> None:
      super().__init__(
          module_loss=module_loss,
          postprocessor=postprocessor,
          init_cfg=init_cfg,
      )
  
      assert check_argument.is_type_list(in_channels, int)
      assert isinstance(out_channel, int)
      assert isinstance(hidden_dim, int)
  
      in_channels = sum(in_channels)
      self.conv1 = nn.Conv2d(
          in_channels, hidden_dim, kernel_size=3, stride=1, padding=1
      )
      self.bn1 = nn.BatchNorm2d(hidden_dim)
      self.relu1 = nn.ReLU(inplace=True)
      self.conv2 = nn.Conv2d(
          hidden_dim, out_channel, kernel_size=1, stride=1, padding=0
      )
  
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 1 to create a new PANHead object from inherited base classes: BaseTextDetHead with example: obj = PANHead(in_channels, hidden_dim, out_channel, module_loss, postprocessor, init_cfg)