code: def __init__(
      self,
      channels,
      levels,
      init=0.5,
      conv_cfg=None,
      norm_cfg=None,
      act_cfg=None,
      upsample_cfg=None,
      pool_cfg=None,
      eps=0.0001,
      init_cfg=None,
  ):
      super().__init__(init_cfg=init_cfg)
      self.act_cfg = act_cfg
      self.upsample_cfg = upsample_cfg
      self.pool_cfg = pool_cfg
      self.eps = eps
      self.levels = levels
      self.bifpn_convs = nn.ModuleList()
      # weighted
      self.weight_two_nodes = nn.Parameter(
          torch.Tensor(2, levels).fill_(init)
      )
      self.weight_three_nodes = nn.Parameter(
          torch.Tensor(3, levels - 2).fill_(init)
      )
      self.relu = nn.ReLU()
      for _ in range(2):
          for _ in range(self.levels - 1):  # 1,2,3
              fpn_conv = nn.Sequential(
                  ConvModule(
                      channels,
                      channels,
                      3,
                      padding=1,
                      conv_cfg=conv_cfg,
                      norm_cfg=norm_cfg,
                      act_cfg=act_cfg,
                      inplace=False,
                  )
              )
              self.bifpn_convs.append(fpn_conv)
  
file_path: mmocr/projects/ABCNet/abcnet/model/bifpn.py
imports: from typing import List
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule
  from mmocr.registry import MODELS
  from mmocr.utils import ConfigType, MultiConfig, OptConfigType
label_desc: Use image node_id 1 to create a new BiFPNLayer object from inherited base classes: BaseModule with example: obj = BiFPNLayer(channels, levels, init, conv_cfg, norm_cfg, act_cfg, upsample_cfg, pool_cfg, eps, init_cfg)