code: def _check_var_scalar_value(x, val, tol=1e-3):
      """
      :param x: var
      :param val: a scalar value
      :return: True if the value of var is equal to val otherwise return False
      """
      if x.val is None:
          return False
      if not isinstance(x.val, (np.ndarray, np.generic)):
          return False
  
      if isinstance(x.val, np.ndarray):
          if x.val.size != 1:
              return False
          x_val = x.val[:][0]
      else:
          x_val = x.val
  
      if abs(x_val - val) < tol:
          return True
      return False
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/gelu_tanh_approximation_fusion.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil import Builder
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _check_var_scalar_value(x, val, tol) and returns: False, False, False, True, False