code: def set_quant_scheme_dtype(
      quant_type, new_scheme=None, new_dtype=None
  ):
      # todo: remove this if we convert string config to enum type.
      if isinstance(quant_type, str):
          assert quant_type in QuantType, "Wrong quant_type"
      if isinstance(new_scheme, str):
          assert new_scheme in QuantScheme, "Wrong quant_scheme"
      if isinstance(new_dtype, str):
          assert new_dtype in QuantDtype, "Wrong quant_dtype"
  
      # TODO: It is not a good idea to directly modify global settings. A better choice is
      # making this function an attribute function of Quantizer and call this function after
      # the quantizer is initialized. However, within current framework of quantization, if
      # we want to modify the dtype & scheme when the quantizer is initialized, we must do
      # some other things (like changing the shapes of scales and zero_points and other quantization
      # information in the subclass).
      global quant_default_settings
      if new_scheme is not None:
          quant_default_settings[quant_type][
              "quant_scheme"
          ] = new_scheme
      if new_dtype is not None:
          quant_default_settings[quant_type]["quant_dtype"] = new_dtype
      return
  
file_path: nni/nni/compression/utils/quantization/settings.py
imports: from typing import Any, Optional
  from .literal import QuantDtype, QuantType, QuantScheme
  from .utils import calculate_qmin_qmax, get_bits_length
label_desc: Use image node_id 1 for calling a global function with example usage: set_quant_scheme_dtype(quant_type, new_scheme, new_dtype) without return types