code: def chi2_log_prob(self, val):
      df = self.parameters["df"]
      eta = 0.5 * df - 1
      result = tf.reduce_sum(eta * tf.log(val), -1)
      result += tf.exp(-0.5 * val)
      result -= tf.lgamma(eta + 1) + (eta + 1) * tf.log(2.0)
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from edward.models.random_variables import *
label_desc: Use image node_id 6 for calling a global function with example usage: chi2_log_prob(val) and returns: result