from tensorflow.python.ops import array_ops

    return math_ops.igammac(math_ops.floor(x + 1), self.rate)

  def _log_normalization(self):
    return self.rate

  def _log_unnormalized_prob(self, x):
    x = self._assert_valid_sample(x, check_integer=True)
    return x * math_ops.log(self.rate) - math_ops.lgamma(x + 1)

  def _mean(self):
    return array_ops.identity(self.rate)

  def _variance(self):
    return array_ops.identity(self.rate)

  @distribution_util.AppendDocstring(
      """Note: when `rate` is an integer, there are actually two modes: `rate`
      and `rate - 1`. In this case we return the larger, i.e., `rate`.""")
  def _mode(self):
    return math_ops.floor(self.rate)

  def _assert_valid_sample(self, x, check_integer=True):
    if not self.validate_args:
      return x
    dependencies = [check_ops.assert_non_negative(x)]
    if check_integer:
