code: def padded_log_poisson(
      predictions, labels, weights_fn=common_layers.weights_all
  ):
      # Expects predictions to already be transformed into log space
      predictions, labels = common_layers.pad_with_zeros(
          predictions, labels
      )
      targets = labels
      weights = weights_fn(targets)
  
      lp_loss = tf.nn.log_poisson_loss(
          targets, predictions, compute_full_loss=True
      )
      return tf.reduce_sum(lp_loss * weights), tf.reduce_sum(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 5 for calling a global function with example usage: padded_log_poisson(predictions, labels, weights_fn) and returns: tf,  tf