code: def check_validation(self) -> None:
      for ts in self._target_spaces.values():
          for target_space in ts.values():
              assert target_space.quant_scheme != None
              if (
                  target_space.type is TargetType.PARAMETER
                  and target_space.quant_scheme != "affine"
              ):
                  warn_msg = f"Only supports affine mode for weight quantization, bug got {target_space.quant_scheme}"
                  _logger.warning(warn_msg)
              elif target_space.type is TargetType.OUTPUT:
                  module = target_space._wrapper.module
                  # case 1: activation module
                  # case 2: module with activation fused_modules
                  fused_modules = target_space._wrapper.fused_modules
                  if not isinstance(
                      module, tuple(ACTIVATION_LIST)
                  ) and not (
                      fused_modules
                      and any(  # type: ignore
                          [
                              isinstance(item, tuple(ACTIVATION_LIST))
                              for item in fused_modules[1:]
                          ]
                      )
                  ):  # type: ignore
                      raise ValueError(
                          "Output quantization is only supported for activation function or"
                          + f"activation module fusion, but got {type(module)}"
                      )
                  if target_space.quant_scheme != "affine":
                      warn_msg = f"Only supports affine mode for output quantization, bug got {target_space.quant_scheme}"
                      _logger.warning(warn_msg)
              if target_space._scaler is not None:
                  raise ValueError(
                      "DoRefa Qauntizer doesn't support for granularity, please set it to False"
                  )
  
imports: from __future__ import annotations
  import logging
  from typing import List, Dict, Union, overload
  import torch
  import torch.nn
  from torch import Tensor
  from nni.common.version import torch_version_is_2
  from ..base.compressor import Compressor, Quantizer
  from ..base.wrapper import ModuleWrapper
  from ..utils import Evaluator, _EVALUATOR_DOCSTRING
  from ..base.target_space import TargetType, QuantizationTargetSpace
label_desc: Use image node_id 5 for calling the DoReFaQuantizer obj's underlying member method code with example usage: obj.check_validation() without return types