class_docstr: Identify the pattern that corresponds to the ``tanh`` approximate version of ``gelu``, and replace it
  with a single ``gelu`` layer with ``mode=TANH_APPROXIMATION``.
  
  The implementation of this pass uses the generic graph pattern matching and transform algorithm
  implemented in ``coremltools.converters.mil.experimental.passes.generic_pass_infrastructure`` and
  documented in ``coremltools/converters/mil/experimental/passes/readme.md``.
  
  `Graph for` ``get_gelu_pattern1()``
  
  ``y = x * (0.5 * (tanh(((.0447)x^3 + x ) * sqrt(2/pi)) + 1))``
  
  .. code-block::
  
          [...] -----> pow (3) ----> mul (.044715) ---> add -----> mul (sqrt(2/pi)) ---> tanh ----> add (1) ----> mul (0.5) -----> mul ---> [...]
            |                                            ^                                                                          ^
            |                                            |                                                                          |
            |------------------------------------------------------------------------------------------------------------------------
  
  
  `Graph for` ``get_gelu_pattern2()``
  
  ``y = (0.5 * x) * (tanh(((.0447)x^3 + x ) * sqrt(2/pi)) + 1)``
  
  .. code-block::
  
                     --------------------------------------------------------------------------------------------------------
                     ^                                                                                                      |
                     |                                                                                                      V
      [...] -----> mul(0.5)    pow (3) ----> mul (.044715) ---> add -----> mul (sqrt(2/pi)) ---> tanh ----> add (1) -----> mul ---> [...]
        |                        ^                               ^
        |                        |                               |
        |---------------------------------------------------------
class_docstr_tok: ["Identify","the","pattern","that","corresponds","to","the","``","tanh","``","approximate","version","of","``","gelu","``",",","and","replace","it","with","a","single","``","gelu","``","layer","with","``","mode=TANH_APPROXIMATION","``",".","The","implementation","of","this","pass","uses","the","generic","graph","pattern","matching","and","transform","algorithm","implemented","in","``","coremltools.converters.mil.experimental.passes.generic_pass_infrastructure","``","and","documented","in","``","coremltools\/converters\/mil\/experimental\/passes\/readme.md","``",".","`","Graph","for","`","``","get_gelu_pattern1","(",")","``","``","y","=","x","*","(","0.5","*","(","tanh","(","(","(",".0447",")","x^3","+","x",")","*","sqrt","(","2\/pi",")",")","+","1",")",")","``","..","code-block",":",":","[","...","]","--","--","-",">","pow","(","3",")","--","--",">","mul","(",".044715",")","--","-",">","add","--","--","-",">","mul","(","sqrt","(","2\/pi",")",")","--","-",">","tanh","--","--",">","add","(","1",")","--","--",">","mul","(","0.5",")","--","--","-",">","mul","--","-",">","[","...","]","|","^","^","|","|","|","|","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","`","Graph","for","`","``","get_gelu_pattern2","(",")","``","``","y","=","(","0.5","*","x",")","*","(","tanh","(","(","(",".0447",")","x^3","+","x",")","*","sqrt","(","2\/pi",")",")","+","1",")","``","..","code-block",":",":","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","^","|","|","V","[","...","]","--","--","-",">","mul","(","0.5",")","pow","(","3",")","--","--",">","mul","(",".044715",")","--","-",">","add","--","--","-",">","mul","(","sqrt","(","2\/pi",")",")","--","-",">","tanh","--","--",">","add","(","1",")","--","--","-",">","mul","--","-",">","[","...","]","|","^","^","|","|","|","|","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-"]
code: def apply(self, prog):
      fuse_all_blocks(
          ops_arrangement=self.get_gelu_pattern1(),
          var_constraints=self.is_var_constraint_satisifed,
          transform_pattern=self.transform_pattern,
          prog=prog,
      )
  
      fuse_all_blocks(
          ops_arrangement=self.get_gelu_pattern2(),
          var_constraints=self.is_var_constraint_satisifed,
          transform_pattern=self.transform_pattern,
          prog=prog,
      )
  
imports: import numpy
  from coremltools.converters.mil.experimental.passes.generic_pass_infrastructure import fuse_all_blocks
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import _check_child_op_type, _check_var_scalar_value, _check_var_scalar_value_in_interval, block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling the fuse_gelu_tanh_approximation obj's underlying member method code with example usage: obj.apply(prog) without return types