code: def abs_vol_difference(predictions, labels, num_classes):
      """Calculates the absolute volume difference for each class between
          labels and predictions.
  
      Args:
          predictions (np.ndarray): predictions
          labels (np.ndarray): labels
          num_classes (int): number of classes to calculate avd for
  
      Returns:
          np.ndarray: avd per class
      """
  
      avd = np.zeros((num_classes))
      eps = 1e-6
      for i in range(num_classes):
          avd[i] = np.abs(
              np.sum(predictions == i) - np.sum(labels == i)
          ) / (np.float(np.sum(labels == i)) + eps)
  
      return avd.astype(np.float32)
  
imports: from __future__ import division
  from __future__ import absolute_import
  from __future__ import print_function
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: abs_vol_difference(predictions, labels, num_classes) and returns: avd