code: def generate(
      self,
      encoder_input,
      beam_size=None,
      maxlen=None,
      prefix_tokens=None,
  ):
      encoder_inputs = self.prepare_encoder_inputs(encoder_input)
      encoder_outs, incremental_states = self._encode(
          encoder_input=encoder_inputs
      )
      return self._decode_target(
          encoder_input,
          encoder_outs,
          incremental_states,
          self.diversity_sibling_gamma,
          beam_size,
          maxlen,
          prefix_tokens,
      )
  
imports: import math
  from typing import List, Tuple
  import torch
  from fairseq import search, utils
  from fairseq.models import FairseqIncrementalDecoder
  from pytorch_translate import utils
  from torch import Tensor
label_desc: Use image node_id 4 for calling the SequenceGenerator obj's underlying member method code with example usage: obj.generate(encoder_input, beam_size, maxlen, prefix_tokens) and returns: self