code: def multi_class_scores(y_true, y_pred, mask):
      """Computes precision/recall/f1 scores using one-hot labels."""
      tp = np.count_nonzero(y_pred * y_true * mask)
      fp = np.count_nonzero(y_pred * (y_true - 1) * mask)
      fn = np.count_nonzero((y_pred - 1) * y_true * mask)
      precision = 0
      recall = 0
      f1 = 0
      if tp + fp:
          precision = np.divide(tp, tp + fp)
      if tp + fn:
          recall = np.divide(tp, tp + fn)
      if precision + recall:
          f1 = np.divide(2 * precision * recall, precision + recall)
      return precision, recall, f1
  
imports: import collections
  import copy
  import functools
  from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, Union
  from absl import logging
  import flax
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.common_lib import debug_utils
  from scenic.train_lib_deprecated import optimizers
  from scenic.train_lib_deprecated import train_utils
label_desc: Use image node_id 2 for calling a global function with example usage: multi_class_scores(y_true, y_pred, mask) and returns: precision,  recall,  f1