code: def rounding_accuracy(
      predictions, labels, weights_fn=common_layers.weights_nonzero
  ):
      """Rounding accuracy for L1/L2 losses: round down the predictions to ints."""
      outputs = tf.squeeze(tf.to_int32(predictions))
      labels = tf.squeeze(labels)
      weights = weights_fn(labels)
      labels = tf.to_int32(labels)
      return tf.to_float(tf.equal(outputs, labels)), weights
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import rouge
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 18 for calling a global function with example usage: rounding_accuracy(predictions, labels, weights_fn) and returns: tf,  weights