class_docstr: An enum indicating the type of quantization to be performed. Allowed options are symmetric
  and affine.
class_docstr_tok: ["An","enum","indicating","the","type","of","quantization","to","be","performed",".","Allowed","options","are","symmetric","and","affine","."]
code: def get_qscheme(
      quantizaton_scheme: "QuantizationScheme", is_per_channel: bool
  ) -> _torch.qscheme:
      _str_to_qscheme_map = {
          "symmetric": _torch.per_tensor_symmetric,
          "affine": _torch.per_tensor_affine,
          "symmetric_per_channel": _torch.per_channel_symmetric,
          "affine_per_channel": _torch.per_channel_affine,
      }
      quantization_scheme_name = quantizaton_scheme.value
      if is_per_channel:
          quantization_scheme_name = (
              f"{quantization_scheme_name}_per_channel"
          )
      return _str_to_qscheme_map[quantization_scheme_name]
  
imports: import logging
  from collections import OrderedDict
  from enum import Enum
  from enum import unique
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import NewType
  from typing import Optional
  from typing import Union
  import cattrs
  import torch
  import torch.ao.quantization
  from attr import define
  from attr import field
  from attrs import validators
  from coremltools.optimize.torch._utils.torch_utils import maybe_convert_str_to_dtype
  from coremltools.optimize.torch._utils.torch_utils import maybe_convert_str_to_mod_type
  from coremltools.optimize.torch.optimization_config import ModuleOptimizationConfig
  from coremltools.optimize.torch.optimization_config import OptimizationConfig
  from coremltools.optimize.torch.optimization_config import _structure_from_dict_hook_factory
label_desc: Use image node_id 1 for calling the QuantizationScheme obj's underlying member method code with example usage: obj.get_qscheme(quantizaton_scheme, is_per_channel) and returns: _str_to_qscheme_map