code: def sparse_categorical_crossentropy(y_true, y_pred):
      """Multi-class cross entropy. Label {0, 1, .., K-1} representation
      for `y_true.`
  
      Args:
        y_true: tf.Tensor.
          Tensor of integers {0, 1, ..., K-1}.
        y_pred: tf.Tensor.
          Tensor of real values (logit probabilities), with shape
          `(y_true.shape, K)`. The outermost dimension is the number of classes.
      """
      y_true = tf.cast(y_true, tf.int64)
      y_pred = tf.cast(y_pred, tf.float32)
      return tf.reduce_mean(
          tf.nn.sparse_softmax_cross_entropy_with_logits(
              logits=y_pred, labels=y_true
          )
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import tensorflow
  from edward.models import RandomVariable
  from edward.util import check_data, get_session, compute_multinomial_mode, with_binary_averaging
label_desc: Use image node_id 7 for calling a global function with example usage: sparse_categorical_crossentropy(y_true, y_pred) and returns: tf