code: def kl_divergence_with_logit(q_logit, p_logit, mask):
      """Computes KL-divergence between to sets of logits for the masked samples."""
      q = tf.nn.softmax(q_logit)
      num_non_zero = tf.reduce_sum(mask)
      qlogq = -tf.nn.softmax_cross_entropy_with_logits_v2(
          labels=q, logits=q_logit
      )
      qlogq = qlogq * mask / num_non_zero
      qlogp = -tf.nn.softmax_cross_entropy_with_logits_v2(
          labels=q, logits=p_logit
      )
      qlogp = qlogp * mask / num_non_zero
      return qlogq - qlogp
  
file_path: neural-structured-learning/research/gam/gam/trainer/adversarial_sparse.py
imports: from .adversarial_dense import get_normalized_vector
  from .adversarial_dense import get_normalizing_constant
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: kl_divergence_with_logit(q_logit, p_logit, mask) and returns: unknown