class_docstr: Determines whether input-weight equalization can help improve quantization for certain modules.
  
  Specifically, this list of modules includes:
      linear
      conv
  
  Determines whether input-weight equalization is recommended based on the comp stat:
      s_c = sqrt(w_c/W)/sqrt(i_c/I)
      where:
          w_c is range of weight for channel c, W is range of weight over all channels
          i_c is range of input for channel c, I is range of input over all channels
  
      if s_c >= threshold or <= 1 / threshold, recommends input-weight equalization
  
  Args:
      ratio_threshold (float): The threshold for s_c to determine if input-weight equalization is suggested
          Should be between 0 and 1 (both non-inclusive)
      ch_axis (int, optional): The channel axis being observed to determine input weight equalization
          Default: 1
  
  * :attr:`ratio_threshold`: The threshold for s_c to determine if input-weight equalization is suggested
      Should be between 0 and 1
  
  * :attr:`ch_axis`: The channel axis being observed to determine input weight equalization
  
  * :attr:`SUPPORTED_MODULES`: This specifies the modules that are supported for input-weight equalization
  
  * :attr:`DEFAULT_PRE_OBSERVER_NAME`: The name of the pre-observer to be inserted for this detector
class_docstr_tok: ["Determines","whether","input-weight","equalization","can","help","improve","quantization","for","certain","modules",".","Specifically",",","this","list","of","modules","includes",":","linear","conv","Determines","whether","input-weight","equalization","is","recommended","based","on","the","comp","stat",":","s_c","=","sqrt","(","w_c\/W",")","\/sqrt","(","i_c\/I",")","where",":","w_c","is","range","of","weight","for","channel","c",",","W","is","range","of","weight","over","all","channels","i_c","is","range","of","input","for","channel","c",",","I","is","range","of","input","over","all","channels","if","s_c",">","=","threshold","or","<","=","1","\/","threshold",",","recommends","input-weight","equalization","Args",":","ratio_threshold","(","float",")",":","The","threshold","for","s_c","to","determine","if","input-weight","equalization","is","suggested","Should","be","between","0","and","1","(","both","non-inclusive",")","ch_axis","(","int",",","optional",")",":","The","channel","axis","being","observed","to","determine","input","weight","equalization","Default",":","1","*",":","attr",":","`","ratio_threshold","`",":","The","threshold","for","s_c","to","determine","if","input-weight","equalization","is","suggested","Should","be","between","0","and","1","*",":","attr",":","`","ch_axis","`",":","The","channel","axis","being","observed","to","determine","input","weight","equalization","*",":","attr",":","`","SUPPORTED_MODULES","`",":","This","specifies","the","modules","that","are","supported","for","input-weight","equalization","*",":","attr",":","`","DEFAULT_PRE_OBSERVER_NAME","`",":","The","name","of","the","pre-observer","to","be","inserted","for","this","detector"]
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:
      input_info (dict): A dict mapping each module to input range information
      weight_info (dict): A dict mapping each module to weight range information
      comp_stats (dict): A dict mapping each module to its corresponding comp stat
  
  Returns a dictionary mapping each module with relevant ModelReportObservers around them to:
      whether input weight equalization is recommended
      their s_c metric compared to the threshold
      the threshold used to make the recommendation
      the channel used for recording data
      the input channel range info
      the weight channel range info
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",":","input_info","(","dict",")",":","A","dict","mapping","each","module","to","input","range","information","weight_info","(","dict",")",":","A","dict","mapping","each","module","to","weight","range","information","comp_stats","(","dict",")",":","A","dict","mapping","each","module","to","its","corresponding","comp","stat","Returns","a","dictionary","mapping","each","module","with","relevant","ModelReportObservers","around","them","to",":","whether","input","weight","equalization","is","recommended","their","s_c","metric","compared","to","the","threshold","the","threshold","used","to","make","the","recommendation","the","channel","used","for","recording","data","the","input","channel","range","info","the","weight","channel","range","info"]
code: def _generate_dict_info(
      self, input_info: Dict, weight_info: Dict, comp_stats: Dict
  ) -> Dict[str, Dict]:
      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:
          input_info (dict): A dict mapping each module to input range information
          weight_info (dict): A dict mapping each module to weight range information
          comp_stats (dict): A dict mapping each module to its corresponding comp stat
  
      Returns a dictionary mapping each module with relevant ModelReportObservers around them to:
          whether input weight equalization is recommended
          their s_c metric compared to the threshold
          the threshold used to make the recommendation
          the channel used for recording data
          the input channel range info
          the weight channel range info
      """
      # store modules input weight equalization info
      input_weight_equalization_info: Dict[str, Dict] = {}
  
      # for each module we add separate set of suggestions
      for module_fqn in input_info:
          # get relevant info for this module
          mod_input_info: Dict = input_info[module_fqn]
          mod_weight_info: Dict = weight_info[module_fqn]
          mod_comp_stat: Dict = comp_stats[module_fqn]
  
          # decide if each channel should have input weight equalization or not
          channel_rec_vals: list = []
  
          for val in mod_comp_stat:
              float_rep: float = val.item()
  
              # decide if recommending input weight equalization
              recommended: bool = (
                  float_rep >= self.ratio_threshold
                  and float_rep <= 1 / self.ratio_threshold
              )
              channel_rec_vals.append(recommended)
  
          # build the return dict input
          # also unpack input and weight dicts into it
          input_weight_equalization_info[module_fqn] = {
              self.RECOMMENDED_KEY: channel_rec_vals,
              self.COMP_METRIC_KEY: mod_comp_stat,
              self.THRESHOLD_KEY: self.ratio_threshold,
              self.CHANNEL_KEY: self.ch_axis,
              **mod_input_info,
              **mod_weight_info,
          }
  
      # return our compiled info for each module
      return input_weight_equalization_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 10 for calling the InputWeightEqualizationDetector obj's underlying member method code with example usage: obj._generate_dict_info(input_info, weight_info, comp_stats) and returns: input_weight_equalization_info