code: def test_gamma_poisson_log_prob(shape):
      gamma_conc = torch.randn(shape).exp()
      gamma_rate = torch.randn(shape).exp()
      value = torch.arange(20.0)
  
      num_samples = 300000
      poisson_rate = dist.Gamma(gamma_conc, gamma_rate).sample(
          (num_samples,)
      )
      log_probs = dist.Poisson(poisson_rate).log_prob(value)
      expected = log_probs.logsumexp(0) - math.log(num_samples)
      actual = GammaPoisson(gamma_conc, gamma_rate).log_prob(value)
      assert_close(actual, expected, rtol=0.05)
  
file_path: pyro/tests/distributions/test_conjugate.py
imports: import math
  import pytest
  import torch
  import pyro.distributions
  from pyro.distributions import BetaBinomial, DirichletMultinomial, GammaPoisson
  from tests.common import assert_close
label_desc: Use image node_id 6 for calling a global function with example usage: test_gamma_poisson_log_prob(shape) without return types