class_docstr:     The graph2seq model consists the following components: 1) node embedding 2) graph embedding 3) decoding. # noqa
      Since the full pipeline will consist all parameters, so we will add prefix to the original parameters
       in each component as follows (except the listed four parameters):
          1) emb_ + parameter_name (eg: ``emb_input_size``)
          2) gnn_ + parameter_name (eg: ``gnn_direction_option``)
          3) dec_ + parameter_name (eg: ``dec_max_decoder_step``)
      Considering neatness, we will only present the four hyper-parameters which don't meet regulations.
      Examples
      -------
      # Build a vocab model from scratch
      >>> "It is just a how-to-use example."
      >>> from graph4nlp.pytorch.modules.config import get_basic_args
      >>> opt = get_basic_args(graph_construction_name="node_emb", graph_embedding_name="gat", decoder_name="stdrnn")
      >>> graph2seq = Graph2Seq.from_args(opt=opt, vocab_model=vocab_model, device=torch.device("cuda:0"))
      >>> batch_graph = [GraphData() for _ in range(2)]
      >>> tgt_seq = torch.Tensor([[1, 2, 3], [4, 5, 6]])
      >>> seq_out, _, _ = graph2seq(batch_graph=batch_graph, tgt_seq=tgt_seq)
      >>> print(seq_out.shape) # [2, 6, 5] (assume the vocabulary size is 5 and max_decoder_step is 6)
  Parameters
  ----------
  vocab_model: VocabModel
      The vocabulary.
  graph_name: str
      The graph type. Excepted in ["dependency", "constituency", "node_emb", "node_emb_refined"].
  gnn: str
      The graph neural network's name. Expected in ["gcn", "gat", "graphsage", "ggnn"]
class_docstr_tok: ["The","graph2seq","model","consists","the","following","components",":","1",")","node","embedding","2",")","graph","embedding","3",")","decoding",".","#","noqa","Since","the","full","pipeline","will","consist","all","parameters",",","so","we","will","add","prefix","to","the","original","parameters","in","each","component","as","follows","(","except","the","listed","four","parameters",")",":","1",")","emb_","+","parameter_name","(","eg",":","``","emb_input_size","``",")","2",")","gnn_","+","parameter_name","(","eg",":","``","gnn_direction_option","``",")","3",")","dec_","+","parameter_name","(","eg",":","``","dec_max_decoder_step","``",")","Considering","neatness",",","we","will","only","present","the","four","hyper-parameters","which","do","n't","meet","regulations",".","Examples","--","--","--","-","#","Build","a","vocab","model","from","scratch",">",">",">","``","It","is","just","a","how-to-use","example",".","''",">",">",">","from","graph4nlp.pytorch.modules.config","import","get_basic_args",">",">",">","opt","=","get_basic_args","(","graph_construction_name=","''","node_emb","''",",","graph_embedding_name=","''","gat","''",",","decoder_name=","''","stdrnn","''",")",">",">",">","graph2seq","=","Graph2Seq.from_args","(","opt=opt",",","vocab_model=vocab_model",",","device=torch.device","(","``","cuda:0","''",")",")",">",">",">","batch_graph","=","[","GraphData","(",")","for","_","in","range","(","2",")","]",">",">",">","tgt_seq","=","torch.Tensor","(","[","[","1",",","2",",","3","]",",","[","4",",","5",",","6","]","]",")",">",">",">","seq_out",",","_",",","_","=","graph2seq","(","batch_graph=batch_graph",",","tgt_seq=tgt_seq",")",">",">",">","print","(","seq_out.shape",")","#","[","2",",","6",",","5","]","(","assume","the","vocabulary","size","is","5","and","max_decoder_step","is","6",")","Parameters","--","--","--","--","--","vocab_model",":","VocabModel","The","vocabulary",".","graph_name",":","str","The","graph","type",".","Excepted","in","[","``","dependency","''",",","``","constituency","''",",","``","node_emb","''",",","``","node_emb_refined","''","]",".","gnn",":","str","The","graph","neural","network","'s","name",".","Expected","in","[","``","gcn","''",",","``","gat","''",",","``","graphsage","''",",","``","ggnn","''","]"]
code: def _build_decoder(
      self,
      decoder_length,
      input_size,
      rnn_input_size,
      hidden_size,
      graph_pooling_strategy,
      vocab_model,
      fix_word_emb=False,
      share_vocab=False,
      use_copy=False,
      use_coverage=False,
      tgt_emb_as_output_layer=False,
      teacher_forcing_rate=1.0,
      rnn_type="lstm",
      attention_type="uniform",
      node_type_num=None,
      fuse_strategy="average",
      rnn_dropout=0.2,
  ):
      if share_vocab and self.enc_word_emb is not None:
          self.dec_word_emb = self.enc_word_emb.word_emb_layer
      else:
          self.dec_word_emb = WordEmbedding(
              vocab_model.out_word_vocab.embeddings.shape[0],
              vocab_model.out_word_vocab.embeddings.shape[1],
              pretrained_word_emb=vocab_model.out_word_vocab.embeddings,
              fix_emb=fix_word_emb,
          ).word_emb_layer
  
      self.seq_decoder = StdRNNDecoder(
          rnn_type=rnn_type,
          max_decoder_step=decoder_length,
          input_size=input_size,
          hidden_size=hidden_size,
          graph_pooling_strategy=graph_pooling_strategy,
          word_emb=self.dec_word_emb,
          vocab=vocab_model.out_word_vocab,
          attention_type=attention_type,
          fuse_strategy=fuse_strategy,
          node_type_num=node_type_num,
          rnn_emb_input_size=rnn_input_size,
          use_coverage=use_coverage,
          use_copy=use_copy,
          tgt_emb_as_output_layer=tgt_emb_as_output_layer,
          dropout=rnn_dropout,
      )
      self.teacher_forcing_rate = teacher_forcing_rate
  
imports: import copy
  import torch.nn.functional
  from graph4nlp.pytorch.modules.graph_embedding_initialization.embedding_construction import WordEmbedding
  from graph4nlp.pytorch.modules.prediction.generation.decoder_strategy import DecoderStrategy
  from graph4nlp.pytorch.modules.prediction.generation.StdRNNDecoder import StdRNNDecoder
  from graph4nlp.pytorch.modules.utils.generic_utils import wordid2str
  from .base import Graph2XBase
label_desc: Use image node_id 2 for calling the Graph2Seq obj's underlying member method code with example usage: obj._build_decoder(decoder_length, input_size, rnn_input_size, hidden_size, graph_pooling_strategy, vocab_model, fix_word_emb, share_vocab, use_copy, use_coverage, tgt_emb_as_output_layer, teacher_forcing_rate, rnn_type, attention_type, node_type_num, fuse_strategy, rnn_dropout) without return types