def testZipfCdfMultidimensional_NonIntegerArgs(self):
    batch_size = 6
    power = tf.constant(([[2.0, 4.0, 5.0]] * batch_size))
    power_v = [2.0, 4.0, 5.0]
    x = np.array([[2.3, 3.5, 4.1, 5.5, 6.8, 7.9]], dtype=np.float32).T
    floor_x = np.floor(x)
    ceil_x = np.ceil(x)
    zipf = tfd.Zipf(power=power, validate_args=True)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((6, 3), 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((6, 3), cdf.shape)
    self.assertAllBetween(self.evaluate(cdf), stats.zipf.cdf(floor_x, power_v), stats.zipf.cdf(ceil_x, power_v))
def testZipfCdfMultidimensional_NonIntegerArgs(self):
    batch_size = 6
    power = tf.constant(([[2.0, 4.0, 5.0]] * batch_size))
    power_v = [2.0, 4.0, 5.0]
    x = np.array([[2.3, 3.5, 4.1, 5.5, 6.8, 7.9]], dtype=np.float32).T
    floor_x = np.floor(x)
    ceil_x = np.ceil(x)
    zipf = tfd.Zipf(power=power, validate_args=True)
    log_cdf = zipf.log_cdf(x)
    self.assertEqual((6, 3), 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((6, 3), cdf.shape)
    self.assertAllBetween(self.evaluate(cdf), stats.zipf.cdf(floor_x, power_v), stats.zipf.cdf(ceil_x, power_v))