code: def softmax_cross_entropy_with_logits(
      sentinel=None, labels=None, logits=None, dim=-1
  ):
      """
      Wrapper around tf.nn.softmax_cross_entropy_with_logits_v2 to handle
      deprecated warning
      """
      # Make sure that all arguments were passed as named arguments.
      if sentinel is not None:
          name = "softmax_cross_entropy_with_logits"
          raise ValueError(
              "Only call `%s` with "
              "named arguments (labels=..., logits=..., ...)" % name
          )
      if labels is None or logits is None:
          raise ValueError("Both labels and logits must be provided.")
  
      try:
          f = tf.nn.softmax_cross_entropy_with_logits_v2
      except AttributeError:
          raise RuntimeError(
              "This version of TensorFlow is no longer supported. See cleverhans/README.md"
          )
  
      labels = tf.stop_gradient(labels)
      loss = f(labels=labels, logits=logits, dim=dim)
  
      return loss
  
imports: import warnings
  import tensorflow
  from tensorflow.python.client import device_lib
  from tensorflow.python.platform import app, flags
label_desc: Use image node_id 3 for calling a global function with example usage: softmax_cross_entropy_with_logits(sentinel, labels, logits, dim) and returns: loss