code: def forward(self, inputs):
      assert len(inputs) == self.levels
      # build top-down and down-top path with stack
      levels = self.levels
      # w relu
      w1 = self.relu(self.weight_two_nodes)
      w1 /= torch.sum(w1, dim=0) + self.eps  # normalize
      w2 = self.relu(self.weight_three_nodes)
      # w2 /= torch.sum(w2, dim=0) + self.eps  # normalize
      # build top-down
      idx_bifpn = 0
      pathtd = inputs
      inputs_clone = []
      for in_tensor in inputs:
          inputs_clone.append(in_tensor.clone())
  
      for i in range(levels - 1, 0, -1):
          _, _, h, w = pathtd[i - 1].shape
          # pathtd[i - 1] = (
          #     w1[0, i - 1] * pathtd[i - 1] + w1[1, i - 1] *
          #     F.interpolate(pathtd[i], size=(h, w), mode='nearest')) / (
          #         w1[0, i - 1] + w1[1, i - 1] + self.eps)
          pathtd[i - 1] = w1[0, i - 1] * pathtd[i - 1] + w1[
              1, i - 1
          ] * F.interpolate(pathtd[i], size=(h, w), mode="nearest")
          pathtd[i - 1] = swish(pathtd[i - 1])
          pathtd[i - 1] = self.bifpn_convs[idx_bifpn](pathtd[i - 1])
          idx_bifpn = idx_bifpn + 1
      # build down-top
      for i in range(0, levels - 2, 1):
          tmp_path = torch.stack(
              [
                  inputs_clone[i + 1],
                  pathtd[i + 1],
                  F.max_pool2d(
                      pathtd[i], kernel_size=3, stride=2, padding=1
                  ),
              ],
              dim=-1,
          )
          norm_weight = w2[:, i] / (w2[:, i].sum() + self.eps)
          pathtd[i + 1] = (norm_weight * tmp_path).sum(dim=-1)
          # pathtd[i + 1] = w2[0, i] * inputs_clone[i + 1]
          #     + w2[1, i] * pathtd[
          #     i + 1] + w2[2, i] * F.max_pool2d(
          #         pathtd[i], kernel_size=3, stride=2, padding=1)
          pathtd[i + 1] = swish(pathtd[i + 1])
          pathtd[i + 1] = self.bifpn_convs[idx_bifpn](pathtd[i + 1])
          idx_bifpn = idx_bifpn + 1
  
      pathtd[levels - 1] = w1[0, levels - 1] * pathtd[levels - 1] + w1[
          1, levels - 1
      ] * F.max_pool2d(
          pathtd[levels - 2], kernel_size=3, stride=2, padding=1
      )
      pathtd[levels - 1] = swish(pathtd[levels - 1])
      pathtd[levels - 1] = self.bifpn_convs[idx_bifpn](
          pathtd[levels - 1]
      )
      return pathtd
  
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 2 for calling the BiFPNLayer obj's underlying member method code with example usage: obj.forward(inputs) and returns: pathtd