class_docstr: Length bonus in beam search.
docstr: Score new token.
  
  Args:
      y (torch.Tensor): 1D torch.int64 prefix tokens.
      state: Scorer state for prefix tokens
      x (torch.Tensor): 2D encoder feature that generates ys.
  
  Returns:
      tuple[torch.Tensor, Any]: Tuple of
          torch.float32 scores for next token (n_vocab)
          and None
docstr_tok: ["Score","new","token",".","Args",":","y","(","torch.Tensor",")",":","1D","torch.int64","prefix","tokens",".","state",":","Scorer","state","for","prefix","tokens","x","(","torch.Tensor",")",":","2D","encoder","feature","that","generates","ys",".","Returns",":","tuple","[","torch.Tensor",",","Any","]",":","Tuple","of","torch.float32","scores","for","next","token","(","n_vocab",")","and","None"]
code: def score(self, y, state, x):
      """Score new token.
  
      Args:
          y (torch.Tensor): 1D torch.int64 prefix tokens.
          state: Scorer state for prefix tokens
          x (torch.Tensor): 2D encoder feature that generates ys.
  
      Returns:
          tuple[torch.Tensor, Any]: Tuple of
              torch.float32 scores for next token (n_vocab)
              and None
  
      """
      return (
          torch.tensor([1.0], device=x.device, dtype=x.dtype).expand(
              self.n
          ),
          None,
      )
  
imports: from typing import Any, List, Tuple
  import torch
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 2 for calling the LengthBonus obj's underlying member method code with example usage: obj.score(y, state, x) and returns: torch,  None