code: def masked_accuracy(preds, labels, mask):
      """Accuracy with masking."""
      correct_prediction = tf.equal(
          tf.argmax(preds, 1), tf.argmax(labels, 1)
      )
      accuracy_all = tf.cast(correct_prediction, tf.float32)
      mask = tf.cast(mask, dtype=tf.float32)
      mask /= tf.reduce_mean(mask)
      accuracy_all *= mask
      return tf.reduce_mean(accuracy_all)
  
imports: import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: masked_accuracy(preds, labels, mask) and returns: tf