code: def test_log_beta_stirling(tol):
      x = torch.logspace(-5, 5, 200)
      y = x.unsqueeze(-1)
  
      expected = log_beta(x, y)
      actual = log_beta(x, y, tol=tol)
  
      assert (actual <= expected).all()
      assert (expected < actual + tol).all()
  
file_path: pyro/tests/ops/test_special.py
imports: import pytest
  import torch
  from scipy.special import iv
  from torch import tensor
  from torch.autograd import grad
  from pyro.ops.special import get_quad_rule, log_beta, log_binomial, log_I1, safe_log
  from tests.common import assert_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_log_beta_stirling(tol) without return types