class_docstr: Beam search implementation.
docstr: Append new token to prefix tokens.
  
  Args:
      xs (torch.Tensor): The prefix token
      x (int): The new token to append
  
  Returns:
      torch.Tensor: New tensor contains: xs + [x] with xs.dtype and xs.device
docstr_tok: ["Append","new","token","to","prefix","tokens",".","Args",":","xs","(","torch.Tensor",")",":","The","prefix","token","x","(","int",")",":","The","new","token","to","append","Returns",":","torch.Tensor",":","New","tensor","contains",":","xs","+","[","x","]","with","xs.dtype","and","xs.device"]
code: def append_token(xs: torch.Tensor, x: int) -> torch.Tensor:
      """Append new token to prefix tokens.
  
      Args:
          xs (torch.Tensor): The prefix token
          x (int): The new token to append
  
      Returns:
          torch.Tensor: New tensor contains: xs + [x] with xs.dtype and xs.device
  
      """
      x = torch.tensor([x], dtype=xs.dtype, device=xs.device)
      return torch.cat((xs, x))
  
imports: import logging
  from itertools import chain
  from typing import Any, Dict, List, NamedTuple, Tuple, Union
  import torch
  from espnet.nets.e2e_asr_common import end_detect
  from espnet.nets.scorer_interface import PartialScorerInterface, ScorerInterface
label_desc: Use image node_id 4 for calling the BeamSearch obj's underlying member method code with example usage: obj.append_token(xs, x) and returns: torch