class_docstr: This code is from https://github.com/WenmuZhou/PAN.pytorch.
  
  Args:
      in_channels (list[int]): A list of 4 numbers of input channels.
      conv_out (int): Number of output channels.
      fpem_repeat (int): Number of FPEM layers before FFM operations.
      align_corners (bool): The interpolation behaviour in FFM operation,
          used in :func:`torch.nn.functional.interpolate`.
      init_cfg (dict or list[dict], optional): Initialization configs.
class_docstr_tok: ["This","code","is","from","https",":","\/\/github.com\/WenmuZhou\/PAN.pytorch",".","Args",":","in_channels","(","list","[","int","]",")",":","A","list","of","4","numbers","of","input","channels",".","conv_out","(","int",")",":","Number","of","output","channels",".","fpem_repeat","(","int",")",":","Number","of","FPEM","layers","before","FFM","operations",".","align_corners","(","bool",")",":","The","interpolation","behaviour","in","FFM","operation",",","used","in",":","func",":","`","torch.nn.functional.interpolate","`",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","configs","."]
docstr: Args:
      x (list[Tensor]): A list of four tensors of shape
          :math:`(N, C_i, H_i, W_i)`, representing C2, C3, C4, C5
          features respectively. :math:`C_i` should matches the number in
          ``in_channels``.
  
  Returns:
      tuple[Tensor]: Four tensors of shape
      :math:`(N, C_{out}, H_0, W_0)` where :math:`C_{out}` is
      ``conv_out``.
docstr_tok: ["Args",":","x","(","list","[","Tensor","]",")",":","A","list","of","four","tensors","of","shape",":","math",":","`","(","N",",","C_i",",","H_i",",","W_i",")","`",",","representing","C2",",","C3",",","C4",",","C5","features","respectively",".",":","math",":","`","C_i","`","should","matches","the","number","in","``","in_channels","``",".","Returns",":","tuple","[","Tensor","]",":","Four","tensors","of","shape",":","math",":","`","(","N",",","C_","{","out","}",",","H_0",",","W_0",")","`","where",":","math",":","`","C_","{","out","}","`","is","``","conv_out","``","."]
code: def forward(self, x: List[torch.Tensor]) -> Tuple[torch.Tensor]:
      """
      Args:
          x (list[Tensor]): A list of four tensors of shape
              :math:`(N, C_i, H_i, W_i)`, representing C2, C3, C4, C5
              features respectively. :math:`C_i` should matches the number in
              ``in_channels``.
  
      Returns:
          tuple[Tensor]: Four tensors of shape
          :math:`(N, C_{out}, H_0, W_0)` where :math:`C_{out}` is
          ``conv_out``.
      """
      c2, c3, c4, c5 = x
      # reduce channel
      c2 = self.reduce_conv_c2(c2)
      c3 = self.reduce_conv_c3(c3)
      c4 = self.reduce_conv_c4(c4)
      c5 = self.reduce_conv_c5(c5)
  
      # FPEM
      for i, fpem in enumerate(self.fpems):
          c2, c3, c4, c5 = fpem(c2, c3, c4, c5)
          if i == 0:
              c2_ffm = c2
              c3_ffm = c3
              c4_ffm = c4
              c5_ffm = c5
          else:
              c2_ffm = c2_ffm + c2
              c3_ffm = c3_ffm + c3
              c4_ffm = c4_ffm + c4
              c5_ffm = c5_ffm + c5
  
      # FFM
      c5 = F.interpolate(
          c5_ffm,
          c2_ffm.size()[-2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
      c4 = F.interpolate(
          c4_ffm,
          c2_ffm.size()[-2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
      c3 = F.interpolate(
          c3_ffm,
          c2_ffm.size()[-2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
      outs = [c2_ffm, c3, c4, c5]
      return tuple(outs)
  
file_path: mmocr/mmocr/models/textdet/necks/fpem_ffm.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from mmengine.model import BaseModule, ModuleList
  from torch import nn
  from mmocr.registry import MODELS
label_desc: Use image node_id 2 for calling the FPEM_FFM obj's underlying member method code with example usage: obj.forward(x) and returns: tuple