class_docstr: **Sequence-to-Sequence Decoder** 的基类。一定需要实现 :meth:`forward` 和 :meth:`decode` 函数，剩下的函数根据需要实现。每个 ``Seq2SeqDecoder`` 都应该有相应的
  :class:`~fastNLP.modules.torch.decoder.State` 对象用来承载该 ``Decoder`` 所需要的 ``Encoder`` 输出、``Decoder`` 需要记录的历史信（例如 :class:`~fastNLP.modules.torch.encoder.LSTM`
  的 hidden 信息）。
class_docstr_tok: ["*","*","Sequence-to-Sequence","Decoder","*","*","\u7684\u57fa\u7c7b\u3002\u4e00\u5b9a\u9700\u8981\u5b9e\u73b0",":","meth",":","`","forward","`","\u548c",":","meth",":","`","decode","`","\u51fd\u6570\uff0c\u5269\u4e0b\u7684\u51fd\u6570\u6839\u636e\u9700\u8981\u5b9e\u73b0\u3002\u6bcf\u4e2a","``","Seq2SeqDecoder","``","\u90fd\u5e94\u8be5\u6709\u76f8\u5e94\u7684",":","class",":","`","~fastNLP.modules.torch.decoder.State","`","\u5bf9\u8c61\u7528\u6765\u627f\u8f7d\u8be5","``","Decoder","``","\u6240\u9700\u8981\u7684","``","Encoder","``","\u8f93\u51fa\u3001","``","Decoder","``","\u9700\u8981\u8bb0\u5f55\u7684\u5386\u53f2\u4fe1\uff08\u4f8b\u5982",":","class",":","`","~fastNLP.modules.torch.encoder.LSTM","`","\u7684","hidden","\u4fe1\u606f\uff09\u3002"]
code: def __init__(self):
      super().__init__()
  
imports: from typing import Union, Tuple
  import math
  import torch
  from torch import nn
  import torch.nn.functional
  from ..attention import AttentionLayer, MultiHeadAttention
  from ....embeddings.torch.utils import get_embeddings
  from ....embeddings.torch.static_embedding import StaticEmbedding
  from .seq2seq_state import State, LSTMState, TransformerState
label_desc: Use image node_id 1 to create a new Seq2SeqDecoder object from inherited base classes: nn with example: obj = Seq2SeqDecoder()