parameters: (self)
return_statement: return bprop
docstring: Grad definition for `Erf` operation.
docstring_summary: Grad definition for `Erf` operation.
docstring_tokens: Grad definition for Erf operation .
function: def get_bprop_erf(self):
      """Grad definition for `Erf` operation."""
      exp = P.Exp()
      square = P.Square()
      sqrt = P.Sqrt()
      cast = P.Cast()
      dtype = P.DType()
      neg = P.Neg()
  
      def bprop(x, out, dout):
          half_root_pi = cast(2 / sqrt(F.scalar_to_tensor(np.pi)), dtype(x))
          x_square = square(x)
          dx = dout * half_root_pi * exp(neg(x_square))
          return (dx,)
  
      return bprop
function_tokens: def get_bprop_erf ( self ) : exp = P . Exp ( ) square = P . Square ( ) sqrt = P . Sqrt ( ) cast = P . Cast ( ) dtype = P . DType ( ) neg = P . Neg ( ) def bprop ( x , out , dout ) : half_root_pi = cast ( 2 / sqrt ( F . scalar_to_tensor ( np . pi ) ) , dtype ( x ) ) x_square = square ( x ) dx = dout * half_root_pi * exp ( neg ( x_square ) ) return ( dx , ) return bprop