


import argparse
import struct
import unittest







class       lowerCamelCase__   :





     def __init__(self		,     UpperCAmelCase       )     ->   None:
      _lowercase							      =data

      # Initialize hash values
      _lowercase							      =[
          0X6_a_0_9_e_6_6_7,
          0Xb_b_6_7_a_e_8_5,
          0X3_c_6_e_f_3_7_2,
          0Xa_5_4_f_f_5_3_a,
          0X5_1_0_e_5_2_7_f,
          0X9_b_0_5_6_8_8_c,
          0X1_f_8_3_d_9_a_b,
          0X5_b_e_0_c_d_1_9,
      ]

      # Initialize round constants
      _lowercase							      =[
          0X4_2_8_a_2_f_9_8,
          0X7_1_3_7_4_4_9_1,
          0Xb_5_c_0_f_b_c_f,
          0Xe_9_b_5_d_b_a_5,
          0X3_9_5_6_c_2_5_b,
          0X5_9_f_1_1_1_f_1,
          0X9_2_3_f_8_2_a_4,
          0Xa_b_1_c_5_e_d_5,
          0Xd_8_0_7_a_a_9_8,
          0X1_2_8_3_5_b_0_1,
          0X2_4_3_1_8_5_b_e,
          0X5_5_0_c_7_d_c_3,
          0X7_2_b_e_5_d_7_4,
          0X8_0_d_e_b_1_f_e,
          0X9_b_d_c_0_6_a_7,
          0Xc_1_9_b_f_1_7_4,
          0Xe_4_9_b_6_9_c_1,
          0Xe_f_b_e_4_7_8_6,
          0X0_f_c_1_9_d_c_6,
          0X2_4_0_c_a_1_c_c,
          0X2_d_e_9_2_c_6_f,
          0X4_a_7_4_8_4_a_a,
          0X5_c_b_0_a_9_d_c,
          0X7_6_f_9_8_8_d_a,
          0X9_8_3_e_5_1_5_2,
          0Xa_8_3_1_c_6_6_d,
          0Xb_0_0_3_2_7_c_8,
          0Xb_f_5_9_7_f_c_7,
          0Xc_6_e_0_0_b_f_3,
          0Xd_5_a_7_9_1_4_7,
          0X0_6_c_a_6_3_5_1,
          0X1_4_2_9_2_9_6_7,
          0X2_7_b_7_0_a_8_5,
          0X2_e_1_b_2_1_3_8,
          0X4_d_2_c_6_d_f_c,
          0X5_3_3_8_0_d_1_3,
          0X6_5_0_a_7_3_5_4,
          0X7_6_6_a_0_a_b_b,
          0X8_1_c_2_c_9_2_e,
          0X9_2_7_2_2_c_8_5,
          0Xa_2_b_f_e_8_a_1,
          0Xa_8_1_a_6_6_4_b,
          0Xc_2_4_b_8_b_7_0,
          0Xc_7_6_c_5_1_a_3,
          0Xd_1_9_2_e_8_1_9,
          0Xd_6_9_9_0_6_2_4,
          0Xf_4_0_e_3_5_8_5,
          0X1_0_6_a_a_0_7_0,
          0X1_9_a_4_c_1_1_6,
          0X1_e_3_7_6_c_0_8,
          0X2_7_4_8_7_7_4_c,
          0X3_4_b_0_b_c_b_5,
          0X3_9_1_c_0_c_b_3,
          0X4_e_d_8_a_a_4_a,
          0X5_b_9_c_c_a_4_f,
          0X6_8_2_e_6_f_f_3,
          0X7_4_8_f_8_2_e_e,
          0X7_8_a_5_6_3_6_f,
          0X8_4_c_8_7_8_1_4,
          0X8_c_c_7_0_2_0_8,
          0X9_0_b_e_f_f_f_a,
          0Xa_4_5_0_6_c_e_b,
          0Xb_e_f_9_a_3_f_7,
          0Xc_6_7_1_7_8_f_2,
      ]

      _lowercase							      =self.preprocessing(self.data       )
      self.final_hash()





     @staticmethod
     def      __A					(UpperCAmelCase       )     ->   bytes:
      _lowercase							      =B'''\x80''' + (B'''\x00''' * (6_3 - (len(UpperCAmelCase       ) + 8) % 6_4))
      _lowercase							      =struct.pack('''>Q'''		,     (len(UpperCAmelCase       ) * 8)       )
      return data + padding + big_endian_integer





     def      __A					(self       )     ->   None:
      # Convert into blocks of 64 bytes
      _lowercase							      =[
          self.preprocessed_data[x : x + 6_4]
          for x in range(0		,     len(self.preprocessed_data       )		,     6_4       )
      ]

      for block in self.blocks:
       # Convert the given block into a list of 4 byte integers
       _lowercase							      =list(struct.unpack('''>16L'''		,     UpperCAmelCase       )       )
       # add 48 0-ed integers
       words += [0] * 4_8

       _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase							      =self.hashes

       for index in range(0		,     6_4       ):
        if index > 1_5:
         # modify the zero-ed indexes at the end of the array
         _lowercase							      =(
             self.ror(words[index - 1_5]		,     7       )
             ^ self.ror(words[index - 1_5]		,     1_8       )
             ^ (words[index - 1_5] >> 3)
         )
         _lowercase							      =(
             self.ror(words[index - 2]		,     1_7       )
             ^ self.ror(words[index - 2]		,     1_9       )
             ^ (words[index - 2] >> 1_0)
         )

         _lowercase							      =(
             words[index - 1_6] + sa + words[index - 7] + sa
         ) % 0X1_0_0_0_0_0_0_0_0

        # Compression
        _lowercase							      =self.ror(UpperCAmelCase		,     6       ) ^ self.ror(UpperCAmelCase		,     1_1       ) ^ self.ror(UpperCAmelCase		,     2_5       )
        _lowercase							      =(e & f) ^ ((~e & 0Xf_f_f_f_f_f_f_f) & g)
        _lowercase							      =(
            h + sa + ch + self.round_constants[index] + words[index]
        ) % 0X1_0_0_0_0_0_0_0_0
        _lowercase							      =self.ror(UpperCAmelCase		,     2       ) ^ self.ror(UpperCAmelCase		,     1_3       ) ^ self.ror(UpperCAmelCase		,     2_2       )
        _lowercase							      =(a & b) ^ (a & c) ^ (b & c)
        _lowercase							      =(sa + maj) % 0X1_0_0_0_0_0_0_0_0

        _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase      ,    _lowercase							      =(
            g,
            f,
            e,
            ((d + tempa) % 0X1_0_0_0_0_0_0_0_0),
            c,
            b,
            a,
            ((tempa + tempa) % 0X1_0_0_0_0_0_0_0_0),
        )

       _lowercase							      =[a, b, c, d, e, f, g, h]

       # Modify final values
       _lowercase							      =[
           ((element + mutated_hash_values[index]) % 0X1_0_0_0_0_0_0_0_0)
           for index, element in enumerate(self.hashes       )
       ]

      _lowercase							      =''''''.join([hex(UpperCAmelCase       )[2:].zfill(8       ) for value in self.hashes]       )





     def      __A					(self		,     UpperCAmelCase		,     UpperCAmelCase       )     ->   int:
      return 0Xf_f_f_f_f_f_f_f & (value << (3_2 - rotations)) | (value >> rotations)







class       lowerCamelCase__   (       unittest.TestCase):





     def      __A					(self       )     ->   None:
      import hashlib

      _lowercase							      =bytes('''Test String'''		,     '''utf-8'''       )
      self.assertEqual(SHAaaa(UpperCAmelCase       ).hash		,     hashlib.shaaaa(UpperCAmelCase       ).hexdigest()       )



def 				UpperCAmelCase_					(							)     ->			None:







 """simple docstring"""


 import doctest

 doctest.testmod()

 _lowercase							      =argparse.ArgumentParser()
 parser.add_argument(
     '''-s'''     ,						'''--string'''     ,						dest='''input_string'''     ,						default='''Hello World!! Welcome to Cryptography'''     ,						help='''Hash the string'''     ,						)
 parser.add_argument(
     '''-f'''     ,						'''--file'''     ,						dest='''input_file'''     ,						help='''Hash contents of a file'''						)

 _lowercase							      =parser.parse_args()

 _lowercase							      =args.input_string

 # hash input should be a bytestring
 if args.input_file:
  with open(args.input_file     ,						'''rb'''						) as f:
   _lowercase							      =f.read()
 else:
  _lowercase							      =bytes(__snake_case     ,						'''utf-8'''						)

 print(SHAaaa(__snake_case						).hash						)


if __name__ == "__main__":
  main()




import logging
import re

import pytorch_quantization
import pytorch_quantization.nn as quant_nn
import torch
from pytorch_quantization import calib
from pytorch_quantization.tensor_quant import QuantDescriptor


snake_case_			  = logging.getLogger(__name__)

snake_case_			  = 50  # max width of layer names
snake_case_			  = 70  # max width of quantizer names

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Tuple			):



     '''simple docstring'''





     lowercase__    :   str      =       parser.add_argument_group('quant_trainer arguments'			)
     group.add_argument('--wprec'	,     type=SCREAMING_SNAKE_CASE_	,     default=8	,     help='weight precision'			)
     group.add_argument('--aprec'	,     type=SCREAMING_SNAKE_CASE_	,     default=8	,     help='activation precision'			)
     group.add_argument('--quant-per-tensor'	,     action='store_true'	,     help='per tensor weight scaling'			)
     group.add_argument('--quant-disable'	,     action='store_true'	,     help='disable all quantizers'			)
     group.add_argument('--quant-disable-embeddings'	,     action='store_true'	,     help='disable all embeddings quantizers'			)
     group.add_argument('--quant-disable-keyword'	,     type=SCREAMING_SNAKE_CASE_	,     nargs='+'	,     help='disable quantizers by keyword'			)
     group.add_argument('--quant-disable-layer-module'	,     type=SCREAMING_SNAKE_CASE_	,     help='disable quantizers by keyword under layer.'			)
     group.add_argument('--quant-enable-layer-module'	,     type=SCREAMING_SNAKE_CASE_	,     help='enable quantizers by keyword under layer'			)
     group.add_argument('--calibrator'	,     default='max'	,     help='which quantization range calibrator to use'			)
     group.add_argument('--percentile'	,     default=SCREAMING_SNAKE_CASE_	,     type=SCREAMING_SNAKE_CASE_	,     help='percentile for PercentileCalibrator'			)
     group.add_argument('--fuse-qkv'	,     action='store_true'	,     help='use the same scale factor for qkv'			)
     group.add_argument('--clip-gelu'	,     metavar='N'	,     type=SCREAMING_SNAKE_CASE_	,     help='clip gelu output maximum value to N'			)
     group.add_argument(
         '--recalibrate-weights'	,     action='store_true'	,     help=(
             'recalibrate weight amaxes by taking the max of the weights.'
             ' amaxes will be computed with the current quantization granularity (axis).'
         )	,     )

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    List[Any]			):



     '''simple docstring'''





     if args.calibrator == "max":
          lowercase__    :   Optional[int]      =       'max'
     elif args.calibrator == "percentile":
          if args.percentile is None:
               raise ValueError('Specify --percentile when using percentile calibrator'			)
          lowercase__    :   Optional[Any]      =       'histogram'
     elif args.calibrator == "mse":
          lowercase__    :   int      =       'histogram'
     else:
          raise ValueError(f"""Invalid calibrator {args.calibrator}"""			)

     lowercase__    :   Any      =       QuantDescriptor(num_bits=args.aprec	,     calib_method=SCREAMING_SNAKE_CASE_			)
     lowercase__    :   List[Any]      =       QuantDescriptor(num_bits=args.wprec	,     axis=(None if args.quant_per_tensor else (0,))			)
     quant_nn.QuantLinear.set_default_quant_desc_input(SCREAMING_SNAKE_CASE_			)
     quant_nn.QuantLinear.set_default_quant_desc_weight(SCREAMING_SNAKE_CASE_			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Optional[Any]	,     SCREAMING_SNAKE_CASE_		:    List[str]	,     SCREAMING_SNAKE_CASE_		:    Union[str, Any]=False	,     SCREAMING_SNAKE_CASE_		:    Any=False			):



     '''simple docstring'''





     logger.info('Configuring Model for Quantization'			)
     logger.info(f"""using quantization package {pytorch_quantization.__file__}"""			)

     if not calib:
          if args.quant_disable_embeddings:
               set_quantizer_by_name(SCREAMING_SNAKE_CASE_	,     ['embeddings']	,     which='weight'	,     _disabled=SCREAMING_SNAKE_CASE_			)

          if args.quant_disable:
               set_quantizer_by_name(SCREAMING_SNAKE_CASE_	,     ['']	,     _disabled=SCREAMING_SNAKE_CASE_			)

          if args.quant_disable_keyword:
               set_quantizer_by_name(SCREAMING_SNAKE_CASE_	,     args.quant_disable_keyword	,     _disabled=SCREAMING_SNAKE_CASE_			)

          if args.quant_disable_layer_module:
               set_quantizer_by_name(SCREAMING_SNAKE_CASE_	,     [R'layer.\d+.' + args.quant_disable_layer_module]	,     _disabled=SCREAMING_SNAKE_CASE_			)

          if args.quant_enable_layer_module:
               set_quantizer_by_name(SCREAMING_SNAKE_CASE_	,     [R'layer.\d+.' + args.quant_enable_layer_module]	,     _disabled=SCREAMING_SNAKE_CASE_			)

          if args.recalibrate_weights:
               recalibrate_weights(SCREAMING_SNAKE_CASE_			)

          if args.fuse_qkv:
               fuse_qkv(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)

     if args.clip_gelu:
          clip_gelu(SCREAMING_SNAKE_CASE_	,     args.clip_gelu			)

     # if args.local_rank in [-1, 0] and not calib:
     print_quant_summary(SCREAMING_SNAKE_CASE_			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Dict			):



     '''simple docstring'''





     logger.info('Enabling Calibration'			)
     for name, module in model.named_modules():
          if name.endswith('_quantizer'			):
               if module._calibrator is not None:
                    module.disable_quant()
                    module.enable_calib()
               else:
                    module.disable()
               logger.info(f"""{name:80}: {module}"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Optional[Any]	,     SCREAMING_SNAKE_CASE_		:    Union[str, Any]			):



     '''simple docstring'''





     logger.info('Loading calibrated amax'			)
     for name, module in model.named_modules():
          if name.endswith('_quantizer'			):
               if module._calibrator is not None:
                    if isinstance(module._calibrator	,     calib.MaxCalibrator			):
                         module.load_calib_amax()
                    else:
                         module.load_calib_amax('percentile'	,     percentile=args.percentile			)
                    module.enable_quant()
                    module.disable_calib()
               else:
                    module.enable()
     model.cuda()
     print_quant_summary(SCREAMING_SNAKE_CASE_			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Any	,     SCREAMING_SNAKE_CASE_		:    Optional[Any]			):



     '''simple docstring'''





     def fusea(SCREAMING_SNAKE_CASE_		:    Any	,     SCREAMING_SNAKE_CASE_		:    str	,     SCREAMING_SNAKE_CASE_		:    List[str]			):
          for mod in [qq, qk, qv]:
               if not hasattr(SCREAMING_SNAKE_CASE_	,     '_amax'			):
                    print('          WARNING: NO AMAX BUFFER'			)
                    return
          lowercase__    :   List[Any]      =       qq._amax.detach().item()
          lowercase__    :   Optional[int]      =       qk._amax.detach().item()
          lowercase__    :   List[str]      =       qv._amax.detach().item()

          lowercase__    :   Tuple      =       max(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
          qq._amax.fill_(SCREAMING_SNAKE_CASE_			)
          qk._amax.fill_(SCREAMING_SNAKE_CASE_			)
          qv._amax.fill_(SCREAMING_SNAKE_CASE_			)
          logger.info(f"""          q={q:5.2f} k={k:5.2f} v={v:5.2f} -> {amax:5.2f}"""			)

     for name, mod in model.named_modules():
          if name.endswith('.attention.self'			):
               logger.info(f"""FUSE_QKV: {name:{name_width}}"""			)
               fusea(mod.matmul_q_input_quantizer	,     mod.matmul_k_input_quantizer	,     mod.matmul_v_input_quantizer			)
               if args.quant_per_tensor:
                    fusea(mod.query._weight_quantizer	,     mod.key._weight_quantizer	,     mod.value._weight_quantizer			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    List[Any]	,     SCREAMING_SNAKE_CASE_		:    Optional[int]			):



     '''simple docstring'''





     for name, mod in model.named_modules():
          if name.endswith('.output.dense'			) and not name.endswith('attention.output.dense'			):
               lowercase__    :   Any      =       mod._input_quantizer._amax.data.detach().item()
               mod._input_quantizer._amax.data.detach().clamp_(max=SCREAMING_SNAKE_CASE_			)
               lowercase__    :   List[str]      =       mod._input_quantizer._amax.data.detach().item()
               logger.info(f"""CLIP_GELU: {name:{name_width}} amax: {amax_init:5.2f} -> {amax:5.2f}"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Optional[int]			):



     '''simple docstring'''





     for name, mod in model.named_modules():
          if hasattr(SCREAMING_SNAKE_CASE_	,     '_weight_quantizer'			) and mod._weight_quantizer.axis is not None:
               lowercase__    :   Union[str, Any]      =       mod.weight.shape[0]
               lowercase__    :   str      =       mod._weight_quantizer._amax.detach()
               lowercase__    :   Any      =       torch.ones(SCREAMING_SNAKE_CASE_	,     dtype=amax.dtype	,     device=amax.device			) * amax
               print(f"""expanding {name} {amax} -> {mod._weight_quantizer._amax}"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Union[str, Any]			):



     '''simple docstring'''





     for name, mod in model.named_modules():
          if hasattr(SCREAMING_SNAKE_CASE_	,     '_weight_quantizer'			):
               if not hasattr(mod.weight_quantizer	,     '_amax'			):
                    print('RECALIB: {name:{name_width}} WARNING: NO AMAX BUFFER'			)
                    continue

               # determine which axes to reduce across
               # e.g. a 4D tensor quantized per axis 0 should reduce over (1,2,3)
               lowercase__    :   Dict      =       set() if mod._weight_quantizer.axis is None else set(mod._weight_quantizer.axis			)
               lowercase__    :   Union[str, Any]      =       set(range(len(mod.weight.size()			)			)			) - axis_set
               lowercase__    :   str      =       pytorch_quantization.utils.reduce_amax(mod.weight	,     axis=SCREAMING_SNAKE_CASE_	,     keepdims=SCREAMING_SNAKE_CASE_			).detach()
               logger.info(f"""RECALIB: {name:{name_width}} {mod._weight_quantizer._amax.flatten()} -> {amax.flatten()}"""			)
               lowercase__    :   Union[str, Any]      =       amax

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Dict	,     SCREAMING_SNAKE_CASE_		:    Optional[Any]=25	,     SCREAMING_SNAKE_CASE_		:    Any=180	,     SCREAMING_SNAKE_CASE_		:    Optional[int]=None			):



     '''simple docstring'''





     if ignore is None:
          lowercase__    :   Tuple      =       []
     elif not isinstance(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			):
          lowercase__    :   str      =       [ignore]

     lowercase__    :   Optional[Any]      =       0
     for name, mod in model.named_modules():
          if not hasattr(SCREAMING_SNAKE_CASE_	,     'weight'			):
               continue
          lowercase__    :   Optional[Any]      =       max(SCREAMING_SNAKE_CASE_	,     len(SCREAMING_SNAKE_CASE_			)			)

     for name, mod in model.named_modules():
          lowercase__    :   Dict      =       getattr(SCREAMING_SNAKE_CASE_	,     '_input_quantizer'	,     SCREAMING_SNAKE_CASE_			)
          lowercase__    :   Optional[Any]      =       getattr(SCREAMING_SNAKE_CASE_	,     '_weight_quantizer'	,     SCREAMING_SNAKE_CASE_			)
          if not hasattr(SCREAMING_SNAKE_CASE_	,     'weight'			):
               continue
          if type(SCREAMING_SNAKE_CASE_			) in ignore:
               continue
          if [True for s in ignore if type(SCREAMING_SNAKE_CASE_			) is str and s in name]:
               continue
          lowercase__    :   Optional[int]      =       f"""Act:{input_q.extra_repr()}"""
          lowercase__    :   Dict      =       f"""Wgt:{weight_q.extra_repr()}"""
          lowercase__    :   Tuple      =       f"""{name:{name_width}} {act_str} {wgt_str}"""
          if len(SCREAMING_SNAKE_CASE_			) <= line_width:
               logger.info(SCREAMING_SNAKE_CASE_			)
          else:
               logger.info(f"""{name:{name_width}} {act_str}"""			)
               logger.info(f"""{"  ":{name_width}} {wgt_str}"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    int			):



     '''simple docstring'''





     lowercase__    :   List[str]      =       0
     for name, mod in model.named_modules():
          if isinstance(SCREAMING_SNAKE_CASE_	,     pytorch_quantization.nn.TensorQuantizer			):
               print(f"""{name:80} {mod}"""			)
               count += 1
     print(f"""{count} TensorQuantizers found in model"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Optional[Any]	,     SCREAMING_SNAKE_CASE_		:    int	,     SCREAMING_SNAKE_CASE_		:    str	,     SCREAMING_SNAKE_CASE_		:    List[str]	,     SCREAMING_SNAKE_CASE_		:    Optional[int]			):



     '''simple docstring'''





     lowercase__    :   Dict      =       getattr(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
     if quantizer_mod is not None:
          assert hasattr(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
          setattr(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
     else:
          logger.warning(f"""{name} has no {quantizer}"""			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    List[Any]	,     SCREAMING_SNAKE_CASE_		:    Optional[int]	,     SCREAMING_SNAKE_CASE_		:    List[Any]="both"	,     **SCREAMING_SNAKE_CASE_		:    Tuple			):



     '''simple docstring'''





     lowercase__    :   Optional[int]      =       f"""Warning: changing {which} quantizers of {name:{qname_width}}"""
     for k, v in kwargs.items():
          s += f""" {k}={v}"""
          if which in ["input", "both"]:
               set_quantizer(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     '_input_quantizer'	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
          if which in ["weight", "both"]:
               set_quantizer(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     '_weight_quantizer'	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
     logger.info(SCREAMING_SNAKE_CASE_			)

def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    Optional[Any]	,     SCREAMING_SNAKE_CASE_		:    Dict	,     **SCREAMING_SNAKE_CASE_		:    List[str]			):



     '''simple docstring'''





     for name, mod in model.named_modules():
          if hasattr(SCREAMING_SNAKE_CASE_	,     '_input_quantizer'			) or hasattr(SCREAMING_SNAKE_CASE_	,     '_weight_quantizer'			):
               for n in names:
                    if re.search(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			):
                         set_quantizers(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     **SCREAMING_SNAKE_CASE_			)
          elif name.endswith('_quantizer'			):
               for n in names:
                    if re.search(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			):
                         lowercase__    :   Any      =       f"""Warning: changing {name:{name_width}}"""
                         for k, v in kwargs.items():
                              s += f""" {k}={v}"""
                              setattr(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			)
                         logger.info(SCREAMING_SNAKE_CASE_			)

