Ejemplo n.º 1
0
 def test_dawsn_larger(self, dtype):
   x = np.random.uniform(1., 100., size=int(1e4)).astype(dtype)
   try:
     from scipy import special  # pylint: disable=g-import-not-at-top
     self.assertAllClose(
         special.dawsn(x), self.evaluate(special_math_ops.dawsn(x)))
   except ImportError as e:
     tf_logging.warn('Cannot test special functions: %s' % str(e))
Ejemplo n.º 2
0
 def test_dawsn_odd(self, dtype):
   x = np.random.uniform(-100., 100., size=int(1e4)).astype(dtype)
   self.assertAllClose(
       self.evaluate(special_math_ops.dawsn(x)),
       self.evaluate(-special_math_ops.dawsn(-x)))
Ejemplo n.º 3
0
 def test_dawsn_boundary(self):
   self.assertAllClose(0., special_math_ops.dawsn(0.))
   self.assertTrue(np.isnan(self.evaluate(special_math_ops.dawsn(np.nan))))