code: def _adjust_labels(labels, predictions):
      """Adjust the 'labels' tensor by squeezing it if needed."""
      labels = tf.cast(labels, tf.int32)
      if len(predictions.shape) == len(labels.shape):
          labels = tf.squeeze(labels, [-1])
      return labels, predictions
  
file_path: autodist/examples/benchmark/utils/modeling/losses/weighted_sparse_categorical_crossentropy.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _adjust_labels(labels, predictions) and returns: labels,  predictions