code: def categorical_log_prob(self, val):
      probs = self.parameters["probs"]
      one_hot = tf.one_hot(val, probs.shape[-1], dtype=tf.float32)
      return tf.reduce_sum(tf.log(probs) * one_hot, -1)
  
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 5 for calling a global function with example usage: categorical_log_prob(val) and returns: tf