class_docstr: Same as BackboneWithFPN but uses custom Daf3DFPN as feature pyramid network
  
  Args:
      backbone: backbone network
      return_layers: a dict containing the names
          of the modules for which the activations will be returned as
          the key of the dict, and the value of the dict is the name
          of the returned activation (which the user can specify).
      in_channels_list: number of channels for each feature map
          that is returned, in the order they are present in the OrderedDict
      out_channels: number of channels in the FPN.
      spatial_dims: 2D or 3D images
      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
class_docstr_tok: ["Same","as","BackboneWithFPN","but","uses","custom","Daf3DFPN","as","feature","pyramid","network","Args",":","backbone",":","backbone","network","return_layers",":","a","dict","containing","the","names","of","the","modules","for","which","the","activations","will","be","returned","as","the","key","of","the","dict",",","and","the","value","of","the","dict","is","the","name","of","the","returned","activation","(","which","the","user","can","specify",")",".","in_channels_list",":","number","of","channels","for","each","feature","map","that","is","returned",",","in","the","order","they","are","present","in","the","OrderedDict","out_channels",":","number","of","channels","in","the","FPN",".","spatial_dims",":","2D","or","3D","images","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"]
code: def __init__(
      self,
      backbone: nn.Module,
      return_layers: dict[str, str],
      in_channels_list: list[int],
      out_channels: int,
      spatial_dims: int | None = None,
      extra_blocks: ExtraFPNBlock | None = None,
  ) -> None:
      super().__init__(
          backbone,
          return_layers,
          in_channels_list,
          out_channels,
          spatial_dims,
          extra_blocks,
      )
  
      if spatial_dims is None:
          if hasattr(backbone, "spatial_dims") and isinstance(
              backbone.spatial_dims, int
          ):
              spatial_dims = backbone.spatial_dims
          elif isinstance(backbone.conv1, nn.Conv2d):
              spatial_dims = 2
          elif isinstance(backbone.conv1, nn.Conv3d):
              spatial_dims = 3
          else:
              raise ValueError(
                  "Could not determine value of  `spatial_dims` from backbone, please provide explicit value."
              )
  
      self.fpn = Daf3dFPN(
          spatial_dims, in_channels_list, out_channels, extra_blocks
      )
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from collections.abc import Callable, Sequence
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from monai.networks.blocks import ADN
  from monai.networks.blocks.aspp import SimpleASPP
  from monai.networks.blocks.backbone_fpn_utils import BackboneWithFPN
  from monai.networks.blocks.convolutions import Convolution
  from monai.networks.blocks.feature_pyramid_network import ExtraFPNBlock, FeaturePyramidNetwork
  from monai.networks.layers.factories import Conv, Norm
  from monai.networks.nets.resnet import ResNet, ResNetBottleneck
label_desc: Use image node_id 1 to create a new Daf3dBackboneWithFPN object from inherited base classes: BackboneWithFPN with example: obj = Daf3dBackboneWithFPN(backbone, return_layers, in_channels_list, out_channels, spatial_dims, extra_blocks)