예제 #1
0
  def testErfInvIntegerInput(self):
    with self.assertRaises(TypeError):
      x = np.array([1, 2, 3]).astype(np.int32)
      special_math.erfinv(x)

    with self.assertRaises(TypeError):
      x = np.array([1, 2, 3]).astype(np.int64)
      special_math.erfinv(x)
예제 #2
0
  def testErfInvIntegerInput(self):
    with self.cached_session():

      with self.assertRaises(TypeError):
        x = np.array([1, 2, 3]).astype(np.int32)
        special_math.erfinv(x)

      with self.assertRaises(TypeError):
        x = np.array([1, 2, 3]).astype(np.int64)
        special_math.erfinv(x)
예제 #3
0
 def testErfInvValues(self):
   if not special:
     return
   x = np.linspace(0., 1., 50).astype(np.float64)
   self.assertAllClose(special.erfinv(x),
                       self.evaluate(special_math.erfinv(x)),
                       atol=0)
예제 #4
0
    def testErfInvValues(self):
        with self.cached_session():
            if not special:
                return

            x = np.linspace(0., 1.0, 50).astype(np.float64)

            expected_x = special.erfinv(x)
            x = special_math.erfinv(x)
            self.assertAllClose(expected_x, x.eval(), atol=0.)
예제 #5
0
  def testErfInvValues(self):
    with self.cached_session():
      if not special:
        return

      x = np.linspace(0., 1.0, 50).astype(np.float64)

      expected_x = special.erfinv(x)
      x = special_math.erfinv(x)
      self.assertAllClose(expected_x, x.eval(), atol=0.)
예제 #6
0
 def _quantile(self, p):
     return np.sqrt(2.0) * self.scale * special_math.erfinv(p)
예제 #7
0
 def _quantile(self, p):
   return np.sqrt(2.0) * self.scale * special_math.erfinv(p)