class_docstr: This transform does the following, for each valid op and if the "op_selector" return True:
  - For each input of dtype float32, inject a "cast" op to change it to float16 dtype
  - For each output of dtype float16, inject a "cast" op to change it back to float32
class_docstr_tok: ["This","transform","does","the","following",",","for","each","valid","op","and","if","the","``","op_selector","''","return","True",":","-","For","each","input","of","dtype","float32",",","inject","a","``","cast","''","op","to","change","it","to","float16","dtype","-","For","each","output","of","dtype","float16",",","inject","a","``","cast","''","op","to","change","it","back","to","float32"]
code: def _check_underflow_to_zero(self, new_var, var):
      # We check whether there are casted values that "becomes" 0 which is not ideal for eps purposes.
      # However we skip arrays with more than 400 in case we compare through a large sparse matrix.
      if (
          new_var.val is not None
          and len(var.val.flatten()) < 400
          and self._close_to_zero(new_var.val, np.float16).any()
      ):
          value_modified = False
          original_val = var.val.flatten()
          new_val = new_var.val.flatten()
  
          for idx in range(len(original_val)):
              if not self._close_to_zero(
                  original_val[idx], np.float32
              ) and self._close_to_zero(new_val[idx], np.float16):
                  new_val[idx] = (
                      self.type_min[np.float16]
                      if np.sign(original_val[idx]) > 0
                      else self.type_negmin[np.float16]
                  )
                  value_modified = True
  
          if value_modified:
              if np.isscalar(new_var.val):
                  new_var._sym_val.val = new_val[0]
              else:
                  new_var._sym_val.val = new_val.reshape(
                      new_var.val.shape
                  )
  
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 7 for calling the FP16ComputePrecision obj's underlying member method code with example usage: obj._check_underflow_to_zero(new_var, var) without return types