def testZipfSample(self):
    power_v = 5.0
    n = int(5000000.0)
    for power_dtype in [tf.float32, tf.float64]:
        power = tf.constant(power_v, dtype=power_dtype)
        for dtype in [tf.int32, tf.int64, tf.float32, tf.float64]:
            zipf = tfd.Zipf(power=power, dtype=dtype, validate_args=True)
            samples = zipf.sample(n, seed=test_util.test_seed())
            sample_values = self.evaluate(samples)
            self.assertEqual((n,), samples.shape)
            self.assertEqual((n,), sample_values.shape)
            self.assertAllClose(sample_values.mean(), stats.zipf.mean(power_v), rtol=0.01)
            self.assertAllClose(sample_values.std(), stats.zipf.std(power_v), rtol=0.03)
def testZipfSample(self):
    power_v = 5.0
    n = int(5000000.0)
    for power_dtype in [tf.float32, tf.float64]:
        power = tf.constant(power_v, dtype=power_dtype)
        for dtype in [tf.int32, tf.int64, tf.float32, tf.float64]:
            zipf = tfd.Zipf(power=power, dtype=dtype, validate_args=True)
            samples = zipf.sample(n, seed=test_util.test_seed())
            sample_values = self.evaluate(samples)
            self.assertEqual((n,), samples.shape)
            self.assertEqual((n,), sample_values.shape)
            self.assertAllClose(sample_values.mean(), stats.zipf.mean(power_v), rtol=0.01)
            self.assertAllClose(sample_values.std(), stats.zipf.std(power_v), rtol=0.03)