class_docstr: Adds a FPN on top of a model.
  Internally, it uses torchvision.models._utils.IntermediateLayerGetter to
  extract a submodel that returns the feature maps specified in return_layers.
  The same limitations of IntermediateLayerGetter apply here.
  Args:
      backbone (nn.Module)
      return_layers (Dict[name, new_name]): 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 (List[int]): number of channels for each feature map
          that is returned, in the order they are present in the OrderedDict
      out_channels (int): number of channels in the FPN.
      norm_layer (callable, optional): Module specifying the normalization layer to use. Default: None
  Attributes:
      out_channels (int): the number of channels in the FPN
class_docstr_tok: ["Adds","a","FPN","on","top","of","a","model",".","Internally",",","it","uses","torchvision.models._utils.IntermediateLayerGetter","to","extract","a","submodel","that","returns","the","feature","maps","specified","in","return_layers",".","The","same","limitations","of","IntermediateLayerGetter","apply","here",".","Args",":","backbone","(","nn.Module",")","return_layers","(","Dict","[","name",",","new_name","]",")",":","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","(","List","[","int","]",")",":","number","of","channels","for","each","feature","map","that","is","returned",",","in","the","order","they","are","present","in","the","OrderedDict","out_channels","(","int",")",":","number","of","channels","in","the","FPN",".","norm_layer","(","callable",",","optional",")",":","Module","specifying","the","normalization","layer","to","use",".","Default",":","None","Attributes",":","out_channels","(","int",")",":","the","number","of","channels","in","the","FPN"]
code: def forward(self, x: Tensor) -> Dict[str, Tensor]:
      x = self.body(x)
      x = self.fpn(x)
      return x
  
file_path: vision/torchvision/models/detection/backbone_utils.py
imports: import warnings
  from typing import Callable, Dict, List, Optional, Union
  from torch import nn, Tensor
  from torchvision.ops import misc
  from torchvision.ops.feature_pyramid_network import ExtraFPNBlock, FeaturePyramidNetwork, LastLevelMaxPool
  from ..None import mobilenet, resnet
  from .._api import _get_enum_from_fn, WeightsEnum
  from .._utils import handle_legacy_interface, IntermediateLayerGetter
label_desc: Use image node_id 2 for calling the BackboneWithFPN obj's underlying member method code with example usage: obj.forward(x) and returns: x