def compute_caption_metrics(self, predictions, references):
    'Computes the eval metrics for decoding.'
    py_types = ([tf.float32] * len(self._SCORE_NAMES))
    scores = tf.py_function(compute_score, (predictions, references, self._word_vocab), py_types)
    for (name, score) in zip(self._SCORE_NAMES, scores):
        scoped_name = 'COCO/{}'.format(name)
        self.caption_metrics[scoped_name].update_state(score)
        self.model_metrics[scoped_name] = self.caption_metrics[scoped_name]
Computes the eval metrics for decoding.
def compute_caption_metrics(self, predictions, references):
    
    py_types = ([tf.float32] * len(self._SCORE_NAMES))
    scores = tf.py_function(compute_score, (predictions, references, self._word_vocab), py_types)
    for (name, score) in zip(self._SCORE_NAMES, scores):
        scoped_name = 'COCO/{}'.format(name)
        self.caption_metrics[scoped_name].update_state(score)
        self.model_metrics[scoped_name] = self.caption_metrics[scoped_name]