def test_invalid_args(self):
        with tf.Session():
            # invalid maxval
            with np.testing.assert_raises(ValueError):
                random_uniform([3, 3]).eval()

            # invalid dtype
            with np.testing.assert_raises(ValueError):
                random_uniform([3, 3], maxval=10000, dtype=tf.float32).eval()
Exemplo n.º 2
0
    def test_min_val(self):
        with tf.Session():
            output = secure_random.random_uniform([6], minval=-10000,
                                                  maxval=0).eval()

            for out in output:
                assert out < 0
Exemplo n.º 3
0
    def test_wrapper(self):
        with tf.Session():
            output = secure_random.random_uniform([3, 3], maxval=10000).eval()

            np.testing.assert_array_equal(output.shape, [3, 3])