code: def labels_from_probs(probs):
      """
      Helper function: computes argmax along last dimension of array to obtain
      labels (max prob or max logit value)
      :param probs: numpy array where probabilities or logits are on last dimension
      :return: array with same shape as input besides last dimension with shape 1
              now containing the labels
      """
      # Compute last axis index
      last_axis = len(np.shape(probs)) - 1
  
      # Label is argmax over last dimension
      labels = np.argmax(probs, axis=last_axis)
  
      # Return as np.int32
      return np.asarray(labels, dtype=np.int32)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import xrange
label_desc: Use image node_id 1 for calling a global function with example usage: labels_from_probs(probs) and returns: np