code: def grad_chi2_logpdf(x, df):
      return np.where(df % 1 == 0, (df - x - 2) / (2 * x), 0)
  
imports: from __future__ import absolute_import, division
  import autograd.numpy
  import scipy.stats
  from autograd.extend import primitive, defvjp
  from autograd.numpy.numpy_vjps import unbroadcast_f
  from autograd.scipy.special import gamma
label_desc: Use image node_id 1 for calling a global function with example usage: grad_chi2_logpdf(x, df) and returns: np