def testZipfCdf_IntegerArgs(self):
    batch_size = 12
    power = tf.constant(([3.0] * batch_size))
    power_v = 3.0
    x = [(- 3), (- 2), (- 1), 0, 1, 2, 3, 4, 5, 6, 7, 8]
    zipf = tfd.Zipf(power=power, validate_args=False)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((batch_size,), log_cdf.shape)
    self.assertAllClose(self.evaluate(log_cdf), stats.zipf.logcdf(x, power_v))
    cdf = zipf.cdf(x)
    self.assertEqual((batch_size,), cdf.shape)
    self.assertAllClose(self.evaluate(cdf), stats.zipf.cdf(x, power_v))
def testZipfCdf_IntegerArgs(self):
    batch_size = 12
    power = tf.constant(([3.0] * batch_size))
    power_v = 3.0
    x = [(- 3), (- 2), (- 1), 0, 1, 2, 3, 4, 5, 6, 7, 8]
    zipf = tfd.Zipf(power=power, validate_args=False)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((batch_size,), log_cdf.shape)
    self.assertAllClose(self.evaluate(log_cdf), stats.zipf.logcdf(x, power_v))
    cdf = zipf.cdf(x)
    self.assertEqual((batch_size,), cdf.shape)
    self.assertAllClose(self.evaluate(cdf), stats.zipf.cdf(x, power_v))