class_docstr: Determines whether dynamic or static quantization is more appropriate for a given module.
  
  Takes advantage of the ModelReportObserver that records range information.
  Stationary distribution of data are strictly above tolerance level for the comparison statistic:
  
      S = average_batch_activation_range/epoch_activation_range
  
  Nonstationary distributions are below or at the tolerance level for this metric.
  
  If the distribution of data right after the module is non-stationary, recommend dynamic quantization
      Otherwise recommend static quantization
  
  Args:
      tolerance (float, optional): The threshold where S metric is stationary above and non-stationary otherwise. Default: 0.5
class_docstr_tok: ["Determines","whether","dynamic","or","static","quantization","is","more","appropriate","for","a","given","module",".","Takes","advantage","of","the","ModelReportObserver","that","records","range","information",".","Stationary","distribution","of","data","are","strictly","above","tolerance","level","for","the","comparison","statistic",":","S","=","average_batch_activation_range\/epoch_activation_range","Nonstationary","distributions","are","below","or","at","the","tolerance","level","for","this","metric",".","If","the","distribution","of","data","right","after","the","module","is","non-stationary",",","recommend","dynamic","quantization","Otherwise","recommend","static","quantization","Args",":","tolerance","(","float",",","optional",")",":","The","threshold","where","S","metric","is","stationary","above","and","non-stationary","otherwise",".","Default",":","0.5"]
docstr: Helper function for generate_detector_report that does the generation of the dictionary.
  This process is done as specified in generate_detector_report documentation
  
  Args:
      model (GraphModule): The prepared and calibrated GraphModule with inserted ModelReportObservers
  
  Returns a Dictionary mapping modules with ModelReportObservers around them to:
          whether dynamic quantization is recommended
          their S metric of input to module
          whether input to module is stationary or non-stationary
          their S metric of output of module
          whether output of module is stationary or non-stationary
          the tolerance level to decided whether input/output is stationary or non-stationary
          whether it is currently supported or planned for the future
docstr_tok: ["Helper","function","for","generate_detector_report","that","does","the","generation","of","the","dictionary",".","This","process","is","done","as","specified","in","generate_detector_report","documentation","Args",":","model","(","GraphModule",")",":","The","prepared","and","calibrated","GraphModule","with","inserted","ModelReportObservers","Returns","a","Dictionary","mapping","modules","with","ModelReportObservers","around","them","to",":","whether","dynamic","quantization","is","recommended","their","S","metric","of","input","to","module","whether","input","to","module","is","stationary","or","non-stationary","their","S","metric","of","output","of","module","whether","output","of","module","is","stationary","or","non-stationary","the","tolerance","level","to","decided","whether","input\/output","is","stationary","or","non-stationary","whether","it","is","currently","supported","or","planned","for","the","future"]
code: def _generate_dict_info(self, model: GraphModule) -> Dict[str, Any]:
      r"""
      Helper function for generate_detector_report that does the generation of the dictionary.
      This process is done as specified in generate_detector_report documentation
  
      Args:
          model (GraphModule): The prepared and calibrated GraphModule with inserted ModelReportObservers
  
      Returns a Dictionary mapping modules with ModelReportObservers around them to:
              whether dynamic quantization is recommended
              their S metric of input to module
              whether input to module is stationary or non-stationary
              their S metric of output of module
              whether output of module is stationary or non-stationary
              the tolerance level to decided whether input/output is stationary or non-stationary
              whether it is currently supported or planned for the future
      """
      # store modules dynamic vs static information
      module_dynamic_static_info = {}
  
      # This for loop goes through the modules, and extracts all relevant information into module_dynamic_static_info
      #   This information primary includes whether the data distributions around a supported module is stationary or not
      #   Based on this, it is recorded whether dynamic or static quantization is recommended
  
      # loop through all submodules included nested ones
      for fqn, module in model.named_modules():
          # if module is Linear has the ModelReportObserver attached to it
          if self._is_supported(module):
              # get pre and post observers for the module
              pre_obs = getattr(module, self.DEFAULT_PRE_OBSERVER_NAME)
              post_obs = getattr(
                  module, self.DEFAULT_POST_OBSERVER_NAME
              )
  
              # get the statistics for each module
              pre_stat = pre_obs.get_batch_to_epoch_ratio()
              post_stat = post_obs.get_batch_to_epoch_ratio()
  
              # record module, pre and post stat, and whether to do dynamic or static based off it
              # true if post observer data distribution is non-stationary, false if it's stationary
              dynamic_recommended = post_stat <= self.tolerance
  
              # specify the classifications for whether data distributions considered stationary or non-stationary
              pre_obs_dist_classif = (
                  self.STATIONARY_STR
                  if pre_stat > self.tolerance
                  else self.NON_STATIONARY_STR
              )
              post_obs_dist_classif = (
                  self.STATIONARY_STR
                  if post_stat > self.tolerance
                  else self.NON_STATIONARY_STR
              )
  
              # check if current support or future support
              is_supported_type = (
                  sum(
                      [
                          isinstance(module, x)
                          for x in self.DEFAULT_DYNAMIC_STATIC_CHECK_SUPPORTED
                      ]
                  )
                  > 0
              )
  
              # store the set of important information for this module
              module_info = {
                  self.TOLERANCE_KEY: self.tolerance,
                  self.DEFAULT_DYNAMIC_REC_KEY: dynamic_recommended,
                  self.PRE_OBS_COMP_STAT_KEY: pre_stat,
                  self.PRE_OBS_DATA_DIST_KEY: pre_obs_dist_classif,
                  self.POST_OBS_COMP_STAT_KEY: post_stat,
                  self.POST_OBS_DATA_DIST_KEY: post_obs_dist_classif,
                  self.IS_CURRENTLY_SUPPORTED_KEY: is_supported_type,
              }
  
              module_dynamic_static_info[fqn] = module_info
  
      return module_dynamic_static_info
  
imports: from typing import Any, Dict, Set, Tuple, Callable, List
  import torch
  import torch.nn
  import torch.ao.nn.qat
  from abc import ABC, abstractmethod
  from torch.ao.quantization.fake_quantize import FakeQuantize
  from torch.ao.quantization.fx.graph_module import GraphModule
  from torch.ao.quantization.fx._model_report.model_report_observer import ModelReportObserver
  from torch.ao.quantization.qconfig import QConfig, default_qconfig, _assert_valid_qconfig
  from torch.ao.quantization.observer import ObserverBase, default_dynamic_quant_observer, default_per_channel_weight_observer, default_observer, default_weight_observer
  from torch.ao.quantization.fx._equalize import default_equalization_qconfig, EqualizationQConfig
  from torch.ao.quantization.observer import _is_activation_post_process
label_desc: Use image node_id 6 for calling the DynamicStaticDetector obj's underlying member method code with example usage: obj._generate_dict_info(model) and returns: module_dynamic_static_info