code: def __init__(self, size, device=None):
      self.size = size
      self.done = False
  
      # The score for each translation on the beam.
      self.scores = torch.zeros(
          size, dtype=torch.float32, device=device
      )
      self.allScores = []
  
      # The backpointers at each time-step.
      self.prevKs = []
  
      # The outputs at each time-step.
      self.nextYs = [
          torch.zeros(size, dtype=torch.int64, device=device).fill_(
              constant.PAD_ID
          )
      ]
      self.nextYs[0][0] = constant.SOS_ID
  
      # The copy indices for each time
      self.copy = []
  
file_path: stanza/stanza/models/common/beam.py
imports: from __future__ import division
  import torch
  import stanza.models.common.seq2seq_constant
label_desc: Use image node_id 1 to create a new Beam object from inherited base classes: object with example: obj = Beam(size, device)