class_docstr: An abstract class that can be used to score the final generated sequences found
  by beam search. Given the predicted sequences and the corresponding log probabilities of
  those sequences, the class calculates and returns the final score of the sequences.
  
  The default implementation scores the sequences using the sum of the log probabilities of
  the sequence, which is passed as input.
class_docstr_tok: ["An","abstract","class","that","can","be","used","to","score","the","final","generated","sequences","found","by","beam","search",".","Given","the","predicted","sequences","and","the","corresponding","log","probabilities","of","those","sequences",",","the","class","calculates","and","returns","the","final","score","of","the","sequences",".","The","default","implementation","scores","the","sequences","using","the","sum","of","the","log","probabilities","of","the","sequence",",","which","is","passed","as","input","."]
docstr: Score the final predictions found by beam search.
  
  # Parameters
  
  predictions : `torch.Tensor`
      A tensor containing the initial predictions with shape `(batch_size, beam_size, max_steps)`.
  
  log_probabilities : `torch.Tensor`
      A tensor containing the log probabilities of the sequence, defined as the sum
      of the log probabilities per token, with shape `(batch_size, beam_size)`.
  
  end_index : `int`
      The index of the end symbol.
  
  # Returns
  
  `torch.Tensor`
      A tensor of the final sequence scores of shape `(batch_size, beam_size)`.
docstr_tok: ["Score","the","final","predictions","found","by","beam","search",".","#","Parameters","predictions",":","`","torch.Tensor","`","A","tensor","containing","the","initial","predictions","with","shape","`","(","batch_size",",","beam_size",",","max_steps",")","`",".","log_probabilities",":","`","torch.Tensor","`","A","tensor","containing","the","log","probabilities","of","the","sequence",",","defined","as","the","sum","of","the","log","probabilities","per","token",",","with","shape","`","(","batch_size",",","beam_size",")","`",".","end_index",":","`","int","`","The","index","of","the","end","symbol",".","#","Returns","`","torch.Tensor","`","A","tensor","of","the","final","sequence","scores","of","shape","`","(","batch_size",",","beam_size",")","`","."]
code: def score(
      self,
      predictions: torch.Tensor,
      log_probabilities: torch.Tensor,
      end_index: int,
  ) -> torch.Tensor:
      """
      Score the final predictions found by beam search.
  
      # Parameters
  
      predictions : `torch.Tensor`
          A tensor containing the initial predictions with shape `(batch_size, beam_size, max_steps)`.
  
      log_probabilities : `torch.Tensor`
          A tensor containing the log probabilities of the sequence, defined as the sum
          of the log probabilities per token, with shape `(batch_size, beam_size)`.
  
      end_index : `int`
          The index of the end symbol.
  
      # Returns
  
      `torch.Tensor`
          A tensor of the final sequence scores of shape `(batch_size, beam_size)`.
      """
      raise NotImplementedError
  
imports: from inspect import signature
  from typing import Any, List, Callable, Tuple, Dict, cast, TypeVar, Optional
  import copy
  import warnings
  import torch
  from allennlp.common import Lazy, Registrable
  from allennlp.common.checks import ConfigurationError
  from allennlp.data import Vocabulary
  from allennlp.nn.util import min_value_of_dtype
label_desc: Use image node_id 1 for calling the FinalSequenceScorer obj's underlying member method code with example usage: obj.score(predictions, log_probabilities, end_index) without return types