示例#1
0
 def test_type_error_raises(self, dtype):
     with self.assertRaisesRegexp(
             TypeError, 'Supported types are tf.float32 and '
             'tf.float64 values'):
         tf_utils.random_floats_cmwc(10, tf.constant(456, tf.int64), dtype)
示例#2
0
 def test_differs_given_different_seed(self):
     floats_1 = tf_utils.random_floats_cmwc(100, tf.constant(123, tf.int64))
     floats_2 = tf_utils.random_floats_cmwc(100, tf.constant(122, tf.int64))
     floats_1, floats_2 = self.evaluate([floats_1, floats_2])
     self.assertFalse(np.array_equal(floats_1, floats_2))
示例#3
0
 def test_expected_dtype(self, dtype):
     floats = tf_utils.random_floats_cmwc(10, tf.constant(456, tf.int64),
                                          dtype)
     self.assertEqual(dtype, floats.dtype)