class_docstr: Feature extractor with OrderedDict return
  
  Wrap a model and extract features as specified by the out indices, the network is
  partially re-built from contained modules.
  
  There is a strong assumption that the modules have been registered into the model in the same
  order as they are used. There should be no reuse of the same nn.Module more than once, including
  trivial modules like `self.relu = nn.ReLU`.
  
  Only submodules that are directly assigned to the model class (`model.feature1`) or at most
  one Sequential container deep (`model.features.1`, with flatten_sequent=True) can be captured.
  All Sequential containers that are directly assigned to the original model will have their
  modules assigned to this module with the name `model.features.1` being changed to `model.features_1`
class_docstr_tok: ["Feature","extractor","with","OrderedDict","return","Wrap","a","model","and","extract","features","as","specified","by","the","out","indices",",","the","network","is","partially","re-built","from","contained","modules",".","There","is","a","strong","assumption","that","the","modules","have","been","registered","into","the","model","in","the","same","order","as","they","are","used",".","There","should","be","no","reuse","of","the","same","nn.Module","more","than","once",",","including","trivial","modules","like","`","self.relu","=","nn.ReLU","`",".","Only","submodules","that","are","directly","assigned","to","the","model","class","(","`","model.feature1","`",")","or","at","most","one","Sequential","container","deep","(","`","model.features.1","`",",","with","flatten_sequent=True",")","can","be","captured",".","All","Sequential","containers","that","are","directly","assigned","to","the","original","model","will","have","their","modules","assigned","to","this","module","with","the","name","`","model.features.1","`","being","changed","to","`","model.features_1","`"]
code: def forward(self, x) -> Dict[str, torch.Tensor]:
      return self._collect(x)
  
imports: from collections import OrderedDict, defaultdict
  from copy import deepcopy
  from functools import partial
  from typing import Dict, List, Sequence, Tuple, Union
  import torch
  import torch.nn
  from torch.utils.checkpoint import checkpoint
  from timm.layers import Format
label_desc: Use image node_id 4 for calling the FeatureDictNet obj's underlying member method code with example usage: obj.forward(x) and returns: self