code: def test_zip_1_gate(rate):
      # if gate is 1 ZIP is Delta(0)
      zip1 = ZeroInflatedPoisson(torch.tensor(rate), gate=torch.ones(1))
      zip2 = ZeroInflatedPoisson(
          torch.tensor(rate), gate_logits=torch.tensor(math.inf)
      )
      delta = Delta(torch.zeros(1))
      s = torch.tensor([0.0, 1.0])
      zip1_prob = zip1.log_prob(s)
      zip2_prob = zip2.log_prob(s)
      delta_prob = delta.log_prob(s)
      assert_close(zip1_prob, delta_prob)
      assert_close(zip2_prob, delta_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 3 for calling a global function with example usage: test_zip_1_gate(rate) without return types