class_docstr: Iterates through each of `model`'s modules and matches modules using unix pattern 
  matching based on `hook_fn_locs` and registers `hook_fn` to the module if there is 
  a match. 
  
  Arguments:
      model (nn.Module): model from which we will extract the activation stats
      hook_fn_locs (List[str]): List of `hook_fn` locations based on Unix type string 
          matching with the name of model's modules. 
      hook_fns (List[Callable]): List of hook functions to be registered at every
          module in `layer_names`.
  
  Inspiration from https://docs.fast.ai/callback.hook.html.
  
  Refer to https://gist.github.com/amaarora/6e56942fcb46e67ba203f3009b30d950 for an example 
  on how to plot Signal Propogation Plots using `ActivationStatsHook`.
class_docstr_tok: ["Iterates","through","each","of","`","model","`","'s","modules","and","matches","modules","using","unix","pattern","matching","based","on","`","hook_fn_locs","`","and","registers","`","hook_fn","`","to","the","module","if","there","is","a","match",".","Arguments",":","model","(","nn.Module",")",":","model","from","which","we","will","extract","the","activation","stats","hook_fn_locs","(","List","[","str","]",")",":","List","of","`","hook_fn","`","locations","based","on","Unix","type","string","matching","with","the","name","of","model","'s","modules",".","hook_fns","(","List","[","Callable","]",")",":","List","of","hook","functions","to","be","registered","at","every","module","in","`","layer_names","`",".","Inspiration","from","https",":","\/\/docs.fast.ai\/callback.hook.html",".","Refer","to","https",":","\/\/gist.github.com\/amaarora\/6e56942fcb46e67ba203f3009b30d950","for","an","example","on","how","to","plot","Signal","Propogation","Plots","using","`","ActivationStatsHook","`","."]
code: def _create_hook(self, hook_fn):
      def append_activation_stats(module, input, output):
          out = hook_fn(module, input, output)
          self.stats[hook_fn.__name__].append(out)
  
      return append_activation_stats
  
imports: import fnmatch
  from copy import deepcopy
  import torch
  from torchvision.ops.misc import FrozenBatchNorm2d
  from timm.layers import BatchNormAct2d, SyncBatchNormAct, FrozenBatchNormAct2d, freeze_batch_norm_2d, unfreeze_batch_norm_2d
  from .model_ema import ModelEma
label_desc: Use image node_id 2 for calling the ActivationStatsHook obj's underlying member method code with example usage: obj._create_hook(hook_fn) and returns: append_activation_stats