def testZipfCdf_NonIntegerArgsInterpolated(self):
    batch_size = 12
    power = tf.constant(([3.0] * batch_size))
    power_v = 3.0
    x = [(- 3.5), (- 0.5), 0.0, 1, 1.1, 2.2, 3.1, 4.0, 5.0, 5.5, 6.4, 7.8]
    floor_x = np.floor(x)
    ceil_x = np.ceil(x)
    zipf = tfd.Zipf(power=power)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((batch_size,), log_cdf.shape)
    self.assertAllBetween(self.evaluate(log_cdf), stats.zipf.logcdf(floor_x, power_v), stats.zipf.logcdf(ceil_x, power_v))
    cdf = zipf.cdf(x)
    self.assertEqual((batch_size,), cdf.shape)
    self.assertAllBetween(self.evaluate(cdf), stats.zipf.cdf(floor_x, power_v), stats.zipf.cdf(ceil_x, power_v))
def testZipfCdf_NonIntegerArgsInterpolated(self):
    batch_size = 12
    power = tf.constant(([3.0] * batch_size))
    power_v = 3.0
    x = [(- 3.5), (- 0.5), 0.0, 1, 1.1, 2.2, 3.1, 4.0, 5.0, 5.5, 6.4, 7.8]
    floor_x = np.floor(x)
    ceil_x = np.ceil(x)
    zipf = tfd.Zipf(power=power)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((batch_size,), log_cdf.shape)
    self.assertAllBetween(self.evaluate(log_cdf), stats.zipf.logcdf(floor_x, power_v), stats.zipf.logcdf(ceil_x, power_v))
    cdf = zipf.cdf(x)
    self.assertEqual((batch_size,), cdf.shape)
    self.assertAllBetween(self.evaluate(cdf), stats.zipf.cdf(floor_x, power_v), stats.zipf.cdf(ceil_x, power_v))