class_docstr: FeatureHookNet
  Wrap a model and extract features specified by the out indices using forward/forward-pre hooks.
  If `no_rewrite` is True, features are extracted via hooks without modifying the underlying
  network in any way.
  If `no_rewrite` is False, the model will be re-written as in the
  FeatureList/FeatureDict case by folding first to second (Sequential only) level modules into this one.
  FIXME this does not currently work with Torchscript, see FeatureHooks class
class_docstr_tok: ["FeatureHookNet","Wrap","a","model","and","extract","features","specified","by","the","out","indices","using","forward\/forward-pre","hooks",".","If","`","no_rewrite","`","is","True",",","features","are","extracted","via","hooks","without","modifying","the","underlying","network","in","any","way",".","If","`","no_rewrite","`","is","False",",","the","model","will","be","re-written","as","in","the","FeatureList\/FeatureDict","case","by","folding","first","to","second","(","Sequential","only",")","level","modules","into","this","one",".","FIXME","this","does","not","currently","work","with","Torchscript",",","see","FeatureHooks","class"]
code: def forward(self, x):
      for name, module in self.items():
          x = module(x)
      out = self.hooks.get_output(x.device)
      return out if self.out_as_dict else list(out.values())
  
imports: from collections import OrderedDict, defaultdict
  from copy import deepcopy
  from functools import partial
  from typing import Dict, List, Tuple
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the FeatureHookNet obj's underlying member method code with example usage: obj.forward(x) and returns: unknown