def test_fresnel_cos_small(self, dtype):
   x = np.random.uniform(0., 1., size=int(1e4)).astype(dtype)
   try:
     from scipy import special  # pylint: disable=g-import-not-at-top
     self.assertAllClose(
         special.fresnel(x)[1], self.evaluate(special_math_ops.fresnel_cos(x)))
   except ImportError as e:
     tf_logging.warn('Cannot test special functions: %s' % str(e))
 def test_fresnel_cos_odd(self, dtype):
   x = np.random.uniform(-100., 100., size=int(1e4)).astype(dtype)
   self.assertAllClose(
       self.evaluate(special_math_ops.fresnel_cos(x)),
       self.evaluate(-special_math_ops.fresnel_cos(-x)))
 def test_fresnel_cos_boundary(self):
   self.assertAllClose(0., special_math_ops.fresnel_cos(0.))
   self.assertTrue(
       np.isnan(self.evaluate(special_math_ops.fresnel_cos(np.nan))))