class_docstr: Module that adds a FPN from on top of a set of feature maps. This is based on
  `"Feature Pyramid Network for Object Detection" <https://arxiv.org/abs/1612.03144>`_.
  
  The feature maps are currently supposed to be in increasing depth
  order.
  
  The input to the model is expected to be an OrderedDict[Tensor], containing
  the feature maps on top of which the FPN will be added.
  
  Args:
      spatial_dims: 2D or 3D images
      in_channels_list: number of channels for each feature map that
          is passed to the module
      out_channels: number of channels of the FPN representation
      extra_blocks: if provided, extra operations will
          be performed. It is expected to take the fpn features, the original
          features and the names of the original features as input, and returns
          a new list of feature maps and their corresponding names
  
  Examples::
  
      >>> m = FeaturePyramidNetwork(2, [10, 20, 30], 5)
      >>> # get some dummy data
      >>> x = OrderedDict()
      >>> x['feat0'] = torch.rand(1, 10, 64, 64)
      >>> x['feat2'] = torch.rand(1, 20, 16, 16)
      >>> x['feat3'] = torch.rand(1, 30, 8, 8)
      >>> # compute the FPN on top of x
      >>> output = m(x)
      >>> print([(k, v.shape) for k, v in output.items()])
      >>> # returns
      >>>   [('feat0', torch.Size([1, 5, 64, 64])),
      >>>    ('feat2', torch.Size([1, 5, 16, 16])),
      >>>    ('feat3', torch.Size([1, 5, 8, 8]))]
code: def __init__(
      self,
      spatial_dims: int,
      in_channels_list: list[int],
      out_channels: int,
      extra_blocks: ExtraFPNBlock | None = None,
  ):
      super().__init__()
  
      conv_type: Callable = Conv[Conv.CONV, spatial_dims]
  
      self.inner_blocks = nn.ModuleList()
      self.layer_blocks = nn.ModuleList()
      for in_channels in in_channels_list:
          if in_channels == 0:
              raise ValueError(
                  "in_channels=0 is currently not supported"
              )
          inner_block_module = conv_type(in_channels, out_channels, 1)
          layer_block_module = conv_type(
              out_channels, out_channels, 3, padding=1
          )
          self.inner_blocks.append(inner_block_module)
          self.layer_blocks.append(layer_block_module)
  
      # initialize parameters now to avoid modifying the initialization of top_blocks
      conv_type_: type[nn.Module] = Conv[Conv.CONV, spatial_dims]
      for m in self.modules():
          if isinstance(m, conv_type_):
              nn.init.kaiming_uniform_(m.weight, a=1)
              nn.init.constant_(m.bias, 0.0)
  
      if extra_blocks is not None:
          if not isinstance(extra_blocks, ExtraFPNBlock):
              raise AssertionError
      self.extra_blocks = extra_blocks
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from collections.abc import Callable
  import torch.nn.functional
  from torch import Tensor, nn
  from monai.networks.layers.factories import Conv, Pool
label_desc: Use image node_id 1 to create a new FeaturePyramidNetwork object from inherited base classes: nn with example: obj = FeaturePyramidNetwork(spatial_dims, in_channels_list, out_channels, extra_blocks)