code: def test_psis_diagnostic(
      scale, krange, zdim, max_particles, num_particles=500 * 1000
  ):
      def model(zdim=1, scale=1.0):
          with pyro.plate("x_axis", zdim, dim=-1):
              pyro.sample("z", dist.Normal(0.0, 1.0).expand([zdim]))
  
      def guide(zdim=1, scale=1.0):
          with pyro.plate("x_axis", zdim, dim=-1):
              pyro.sample("z", dist.Normal(0.0, scale).expand([zdim]))
  
      k = psis_diagnostic(
          model,
          guide,
          num_particles=num_particles,
          max_simultaneous_particles=max_particles,
          zdim=zdim,
          scale=scale,
      )
      assert k > krange[0] and k < krange[1]
  
file_path: pyro/tests/infer/test_util.py
imports: import math
  import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.infer.importance import psis_diagnostic
  from pyro.infer.util import MultiFrameTensor
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_psis_diagnostic(scale, krange, zdim, max_particles, num_particles) without return types