class_docstr: Describes how to quantize a layer or a part of the network by providing
  settings (observer classes) for activations and weights respectively.
  
  
  Note that QConfig needs to contain observer **classes** (like MinMaxObserver) or a callable that returns
  instances on invocation, not the concrete observer instances themselves.
  Quantization preparation function will instantiate observers multiple times for each of the layers.
  
  
  Observer classes have usually reasonable default arguments, but they can be overwritten with `with_args`
  method (that behaves like functools.partial)::
  
    my_qconfig = QConfig(
        activation=MinMaxObserver.with_args(dtype=torch.qint8),
        weight=default_observer.with_args(dtype=torch.qint8))
class_docstr_tok: ["Describes","how","to","quantize","a","layer","or","a","part","of","the","network","by","providing","settings","(","observer","classes",")","for","activations","and","weights","respectively",".","Note","that","QConfig","needs","to","contain","observer","*","*","classes","*","*","(","like","MinMaxObserver",")","or","a","callable","that","returns","instances","on","invocation",",","not","the","concrete","observer","instances","themselves",".","Quantization","preparation","function","will","instantiate","observers","multiple","times","for","each","of","the","layers",".","Observer","classes","have","usually","reasonable","default","arguments",",","but","they","can","be","overwritten","with","`","with_args","`","method","(","that","behaves","like","functools.partial",")",":",":","my_qconfig","=","QConfig","(","activation=MinMaxObserver.with_args","(","dtype=torch.qint8",")",",","weight=default_observer.with_args","(","dtype=torch.qint8",")",")"]
code: def __new__(cls, activation, weight):
      # catch common mistakes
      if isinstance(activation, nn.Module) or isinstance(
          weight, nn.Module
      ):
          raise ValueError(
              "QConfig received observer instance, please pass observer class instead. "
              + "Use MyObserver.with_args(x=1) to override arguments to constructor if needed"
          )
      return super().__new__(cls, activation, weight)
  
imports: from collections import namedtuple
  from typing import Optional, Any, Union, Type
  import torch
  import torch.nn
  from torch.ao.quantization.fake_quantize import FakeQuantize, FakeQuantizeBase, default_fake_quant, default_dynamic_fake_quant, default_per_channel_weight_fake_quant, default_weight_fake_quant, default_fused_act_fake_quant, default_fused_wt_fake_quant, FusedMovingAvgObsFakeQuantize, default_fused_per_channel_wt_fake_quant, default_embedding_fake_quant, default_embedding_fake_quant_4bit, fused_wt_fake_quant_range_neg_127_to_127, fused_per_channel_wt_fake_quant_range_neg_127_to_127
  from .observer import _PartialWrapper, MinMaxObserver, HistogramObserver, MovingAverageMinMaxObserver, NoopObserver, PlaceholderObserver, ReuseInputObserver, default_debug_observer, default_dynamic_quant_observer, default_float_qparams_observer, default_float_qparams_observer_4bit, default_observer, default_per_channel_weight_observer, default_placeholder_observer, default_weight_observer, weight_observer_range_neg_127_to_127, per_channel_weight_observer_range_neg_127_to_127, default_reuse_input_observer, ObserverBase
  import warnings
  import copy
label_desc: Use image node_id 1 for calling the QConfig obj's underlying member method code with example usage: obj.__new__(cls, activation, weight) and returns: super