code: def test_zip_0_gate(rate):
      # if gate is 0 ZIP is Poisson
      zip1 = ZeroInflatedPoisson(
          torch.tensor(rate), gate=torch.zeros(1)
      )
      zip2 = ZeroInflatedPoisson(
          torch.tensor(rate), gate_logits=torch.tensor(-99.9)
      )
      pois = Poisson(torch.tensor(rate))
      s = pois.sample((20,))
      zip1_prob = zip1.log_prob(s)
      zip2_prob = zip2.log_prob(s)
      pois_prob = pois.log_prob(s)
      assert_close(zip1_prob, pois_prob)
      assert_close(zip2_prob, pois_prob)
  
file_path: pyro/tests/distributions/test_zero_inflated.py
imports: import math
  import pytest
  import torch
  from pyro.distributions import Delta, NegativeBinomial, Normal, Poisson, ZeroInflatedDistribution, ZeroInflatedNegativeBinomial, ZeroInflatedPoisson
  from pyro.distributions.util import broadcast_shape
  from tests.common import assert_close
label_desc: Use image node_id 2 for calling a global function with example usage: test_zip_0_gate(rate) without return types