class_docstr: Return the elementwise Gaussian error linear unit activation function for ``x``.
  
  You can use ``EXACT``, ``TANH_APPROXIMATION``, or ``SIGMOID_APPROXIMATION`` values
  based on the following formulas:
  
  * ``EXACT``:
  
  .. math::
     f(x) = 0.5x\left ( 1+\rm{erf}\left ( \frac{x}{\sqrt{2}} \right ) \right )
  
  * ``TANH_APPROXIMATION``:
  
  .. math::
     f(x) = 0.5x\left ( 1+\rm{tanh}\left ( \sqrt{2/\pi}\left ( x + 0.044715x^3 \right ) \right ) \right )
  
  * ``SIGMOID_APPROXIMATION``:
  
  .. math::
     f(x) = x*\rm{sigmoid}(1.702x)
  
  
  Parameters
  ----------
  x: tensor<\*?, T> (Required)
  
  mode: const str (Optional)
      * Use ``'EXACT'``, ``'TANH_APPROXIMATION'``, or ``'SIGMOID_APPROXIMATION'`` for ``str``.
      * Default is ``'EXACT'``.
  
  Returns
  -------
  tensor<\*?, T>
      * A tensor of the same shape and type as ``x``.
  
  Attributes
  ----------
  T: fp16, fp32
class_docstr_tok: ["Return","the","elementwise","Gaussian","error","linear","unit","activation","function","for","``","x","``",".","You","can","use","``","EXACT","``",",","``","TANH_APPROXIMATION","``",",","or","``","SIGMOID_APPROXIMATION","``","values","based","on","the","following","formulas",":","*","``","EXACT","``",":","..","math",":",":","f","(","x",")","=","0.5x\\left","(","1+\\rm","{","erf","}","\\left","(","\\frac","{","x","}","{","\\sqrt","{","2","}","}","\\right",")","\\right",")","*","``","TANH_APPROXIMATION","``",":","..","math",":",":","f","(","x",")","=","0.5x\\left","(","1+\\rm","{","tanh","}","\\left","(","\\sqrt","{","2\/\\pi","}","\\left","(","x","+","0.044715x^3","\\right",")","\\right",")","\\right",")","*","``","SIGMOID_APPROXIMATION","``",":","..","math",":",":","f","(","x",")","=","x","*","\\rm","{","sigmoid","}","(","1.702x",")","Parameters","--","--","--","--","--","x",":","tensor","<","\\","*","?",",","T",">","(","Required",")","mode",":","const","str","(","Optional",")","*","Use","``","'EXACT","'","``",",","``","'TANH_APPROXIMATION","'","``",",","or","``","'SIGMOID_APPROXIMATION","'","``","for","``","str","``",".","*","Default","is","``","'EXACT","'","``",".","Returns","--","--","--","-","tensor","<","\\","*","?",",","T",">","*","A","tensor","of","the","same","shape","and","type","as","``","x","``",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32"]
code: def type_inference(self):
      allowed_values = {
          "EXACT",
          "TANH_APPROXIMATION",
          "SIGMOID_APPROXIMATION",
      }
      if self.mode.val not in allowed_values:
          msg = '"gelu" op: unrecognized value of mode: "{}". Allowed values are {}'
          raise ValueError(msg.format(self.mode.val, allowed_values))
      return self.x.sym_type
  
imports: import math
  import numpy
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.operation import VALUE, Operation, precondition
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from .elementwise_unary import elementwise_unary
label_desc: Use image node_id 3 for calling the gelu obj's underlying member method code with example usage: obj.type_inference() and returns: self