code: def __init__(self, size, sos, eos):
      self.size = size
      self.tt = torch.cuda
      # The score for each translation on the beam.
      self.scores = self.tt.FloatTensor(size).zero_()
      # The backpointers at each time-step.
      self.prevKs = []
      # The outputs at each time-step.
      self.nextYs = [self.tt.LongTensor(size).fill_(0)]
      self.nextYs[0][0] = sos
      # Has EOS topped the beam yet.
      self._eos = eos
      self.eosTop = False
      # Time and k pair for finished.
      self.finished = []
  
imports: import torch
  import torch.nn
  import numpy
  from transformers import RobertaConfig, RobertaModel, RobertaTokenizer, BartConfig, BartForConditionalGeneration, BartTokenizer, T5Config, T5ForConditionalGeneration, T5Tokenizer
  import logging
label_desc: Use image node_id 1 to create a new Beam object from inherited base classes: object with example: obj = Beam(size, sos, eos)