code: def local_ultra_fast_sigmoid(node):
      """
      When enabled, change all sigmoid to ultra_fast_sigmoid.
  
      For example do mode.including('local_ultra_fast_sigmoid')
      or use the Theano flag optimizer_including=local_ultra_fast_sigmoid.
  
      This speeds up the sigmoid op by using an approximation.
  
      This is done after the stabilization and specialize phases
      to avoid interacting with them.
  
      """
      if (
          isinstance(node.op, tensor.Elemwise)
          and node.op.scalar_op == scalar_sigmoid
      ):
          out = ultra_fast_sigmoid(node.inputs[0])
          copy_stack_trace(node.outputs[0], out)
  
          def values_eq_approx_remove_low_prec(a, b):
              # atol is found by trial/error.
              # Other test could fail without good reason.
              return tensor.TensorType.values_eq_approx(a, b, atol=0.02)
  
          # Let DebugMode know that there this opt approx the values.
          out.tag.values_eq_approx = values_eq_approx_remove_low_prec
          return [out]
  
imports: from __future__ import absolute_import, print_function, division
  import warnings
  import numpy
  import theano
  from theano import config, gof, printing, scalar
  from theano.compat import imap
  from theano.printing import pprint
  from theano.tensor import basic
  from theano.tensor import elemwise, opt, NotScalarConstantError
  from theano.tensor.type import values_eq_approx_remove_inf
  from theano.gof.opt import copy_stack_trace
label_desc: Use image node_id 1 for calling a global function with example usage: local_ultra_fast_sigmoid(node) and returns: list, tensor