class_docstr: Rescores source and target tokens based on a model
docstr: Rescores hypotheses based on a given model and input tokens.
  src_tokens: a tensor with size bsz x max_src_len
  hypos: a list with length of bsz * beam_size
docstr_tok: ["Rescores","hypotheses","based","on","a","given","model","and","input","tokens",".","src_tokens",":","a","tensor","with","size","bsz","x","max_src_len","hypos",":","a","list","with","length","of","bsz","*","beam_size"]
code: def score(self, src_tokens, hypos):
      """Rescores hypotheses based on a given model and input tokens.
      src_tokens: a tensor with size bsz x max_src_len
      hypos: a list with length of bsz * beam_size
      """
      if self.model is None:
          return
  
      # if cuda is available, we convert src_tokens to cuda. all other
      # tensors copy src_tokens's type (cpu or gpu)
      if torch.cuda.is_available():
          src_tokens = src_tokens.cuda()
  
      encoder_inputs, tgt_tokens = self.prepare_inputs(
          src_tokens, hypos
      )
      hypos_scores, _, _ = self.score_tokens(encoder_inputs, tgt_tokens)
      return hypos_scores
  
imports: import torch
  from pytorch_translate import utils
label_desc: Use image node_id 8 for calling the SimpleModelScorer obj's underlying member method code with example usage: obj.score(src_tokens, hypos) and returns: hypos_scores