code: def check_grad(value, *params):
      grads = grad(value.sum(), params, create_graph=True)
      assert all(torch.isfinite(g).all() for g in grads)
  
file_path: pyro/tests/distributions/test_extended.py
imports: import math
  import pytest
  import torch
  from torch.autograd import grad
  import pyro.distributions
  from pyro.contrib.epidemiology.distributions import set_approx_log_prob_tol
  from tests.common import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: check_grad(value) without return types