code: def lenpred_stats(targets_length_pred, targets_length):
      lenpred_diff = tf.abs(
          targets_length_pred - tf.cast(targets_length, tf.int32)
      )
      lenpred_acc = tf.cast(tf.equal(lenpred_diff, 0), tf.float32)
      lenpred_acc = tf.reduce_mean(lenpred_acc)
      lenpred_acc5 = tf.cast(tf.less_equal(lenpred_diff, 5), tf.float32)
      lenpred_acc5 = tf.reduce_mean(lenpred_acc5)
      return lenpred_acc, lenpred_acc5
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import transformer_glow_layers_ops
  from tensor2tensor.models.transformer import transformer_decoder_layer
  from tensor2tensor.models.transformer import transformer_encoder
  from tensor2tensor.models.transformer import transformer_prepare_encoder
  from tensor2tensor.utils import learning_rate
  from tensor2tensor.utils import mlperf_log
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 13 for calling a global function with example usage: lenpred_stats(targets_length_pred, targets_length) and returns: lenpred_acc,  lenpred_acc5