class_docstr: Base class for all type casting related quantization, such as fp32->fp16, int32->int16, etc.
  
  For each valid op, if the "op_selector" return True:
  - For each input with dtype `origin_dtype`, inject a "cast" op to change it to `target_dtype`.
  - For each output with dtype `target_dtype`, inject a "cast" op to change it back to `origin_dtype`.
  All child classes need to specify `origin_dtype` and `target_dtype`.
class_docstr_tok: ["Base","class","for","all","type","casting","related","quantization",",","such","as","fp32-",">","fp16",",","int32-",">","int16",",","etc",".","For","each","valid","op",",","if","the","``","op_selector","''","return","True",":","-","For","each","input","with","dtype","`","origin_dtype","`",",","inject","a","``","cast","''","op","to","change","it","to","`","target_dtype","`",".","-","For","each","output","with","dtype","`","target_dtype","`",",","inject","a","``","cast","''","op","to","change","it","back","to","`","origin_dtype","`",".","All","child","classes","need","to","specify","`","origin_dtype","`","and","`","target_dtype","`","."]
docstr: Determines if a param of an op should be cast to target_dtype.
  
  There are two cases that an op shouldn't be cast:
  1. The op's parameter doesn't support target_dtype.
  2. The cast op itself doesn't support target_dtype
docstr_tok: ["Determines","if","a","param","of","an","op","should","be","cast","to","target_dtype",".","There","are","two","cases","that","an","op","should","n't","be","cast",":","1",".","The","op","'s","parameter","does","n't","support","target_dtype",".","2",".","The","cast","op","itself","does","n't","support","target_dtype"]
code: def should_cast_parameter(
      self, op: Operation, param_name: str
  ) -> bool:
      """
      Determines if a param of an op should be cast to target_dtype.
  
      There are two cases that an op shouldn't be cast:
      1. The op's parameter doesn't support target_dtype.
      2. The cast op itself doesn't support target_dtype
      """
      type_domain = getattr(
          op.input_spec.input_types[param_name], "type_domain", None
      )
      if (
          type_domain
          and types.string_to_builtin(self.target_dtype)
          not in type_domain
      ):
          return False
      if (
          self.target_dtype
          not in SSAOpRegistry._get_core_op_cls(
              "cast"
          ).supported_dtypes()
      ):
          return False
  
      return True
  
imports: from abc import abstractmethod
  from enum import Enum
  from typing import Set, Text
  import numpy
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Operation, types
  from coremltools.converters.mil.mil.block import is_current_opset_version_compatible_with
  from coremltools.converters.mil.mil.ops.registry import SSAOpRegistry
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil.program import Program
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
label_desc: Use image node_id 4 for calling the CastTypeQuantization obj's underlying member method code with example usage: obj.should_cast_parameter(op, param_name) and returns: True, False, False