code: def _get_entropy(logits):
      probs = tf.nn.softmax(logits) + 1e-8
      entropy = -probs * tf.log(probs)
      entropy = tf.reduce_sum(entropy, -1)
      return entropy
  
imports: import tensorflow
  from texar.tf.losses.losses_utils import mask_and_reduce, reduce_dimensions
  from texar.tf.utils.shapes import get_rank
label_desc: Use image node_id 1 for calling a global function with example usage: _get_entropy(logits) and returns: entropy