class_docstr:     The strategy for sequence decoding. Support beam seach only temporally.
  Parameters
  ----------
  beam_size: int
      The beam size for beam search.
  batch_graph: GraphData
      The input graph
  decoder: DecoderBase
      The decoder instance.
  rnn_type: str, option=["lstm", "gru"]
      The type of RNN.
  use_copy: bool, default=False
      Whether use ``copy`` mechanism. See pointer network. Note that you must use attention first.
  use_coverage: bool, default=False
      Whether use ``coverage`` mechanism. Note that you must use attention first.
  max_decoder_step: int, default=50
      The maximal decoding step.
docstr:     Generate sequences using beam search.
  Parameters
  ----------
  batch_graph: GraphData
  oov_dict: VocabModel, default=None
      The vocabulary for copy mechanism.
  topk: int, default=1
  
  Returns
  -------
  prediction: list
docstr_tok: ["Generate","sequences","using","beam","search",".","Parameters","--","--","--","--","--","batch_graph",":","GraphData","oov_dict",":","VocabModel",",","default=None","The","vocabulary","for","copy","mechanism",".","topk",":","int",",","default=1","Returns","--","--","--","-","prediction",":","list"]
code: def generate(self, batch_graph, oov_dict=None, topk=1):
      """
          Generate sequences using beam search.
      Parameters
      ----------
      batch_graph: GraphData
      oov_dict: VocabModel, default=None
          The vocabulary for copy mechanism.
      topk: int, default=1
  
      Returns
      -------
      prediction: list
      """
      params = self.decoder.extract_params(batch_graph)
      params["tgt_seq"] = None
      params["beam_size"] = self.beam_size
      params["topk"] = topk
      params["oov_dict"] = oov_dict
      return self._beam_search(**params)
  
imports: from copy import deepcopy
  import torch
  import torch.nn
  from graph4nlp.pytorch.modules.prediction.generation.base import DecoderBase
label_desc: Use image node_id 2 for calling the DecoderStrategy obj's underlying member method code with example usage: obj.generate(batch_graph, oov_dict, topk) and returns: self