code: def test_zinb_1_gate(total_count, probs):
      # if gate is 1 ZINB is Delta(0)
      zinb1 = ZeroInflatedNegativeBinomial(
          total_count=torch.tensor(total_count),
          gate=torch.ones(1),
          probs=torch.tensor(probs),
      )
      zinb2 = ZeroInflatedNegativeBinomial(
          total_count=torch.tensor(total_count),
          gate_logits=torch.tensor(math.inf),
          probs=torch.tensor(probs),
      )
      delta = Delta(torch.zeros(1))
      s = torch.tensor([0.0, 1.0])
      zinb1_prob = zinb1.log_prob(s)
      zinb2_prob = zinb2.log_prob(s)
      delta_prob = delta.log_prob(s)
      assert_close(zinb1_prob, delta_prob)
      assert_close(zinb2_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 6 for calling a global function with example usage: test_zinb_1_gate(total_count, probs) without return types