class_docstr: This transform does the following, for each op that supports int16:
  - For each input of dtype int32 which actually supports int16, inject a "cast" op to change it
    to int16 dtype.
  - For each output of dtype int16, inject a "cast" op to change it back to int32.
  It's mainly for int16 op ANE residency.
class_docstr_tok: ["This","transform","does","the","following",",","for","each","op","that","supports","int16",":","-","For","each","input","of","dtype","int32","which","actually","supports","int16",",","inject","a","``","cast","''","op","to","change","it","to","int16","dtype",".","-","For","each","output","of","dtype","int16",",","inject","a","``","cast","''","op","to","change","it","back","to","int32",".","It","'s","mainly","for","int16","op","ANE","residency","."]
docstr: Determines if op is valid for int16 casting.
docstr_tok: ["Determines","if","op","is","valid","for","int16","casting","."]
code: def is_valid_op(self, op: Operation) -> bool:
      """Determines if op is valid for int16 casting."""
      return (
          op.op_type in self._PREFER_INT16_OPS
          and not self.int16_overflow(op)
      )
  
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 5 for calling the add_int16_cast obj's underlying member method code with example usage: obj.is_valid_op(op) and returns: unknown