class_docstr: 每个 ``Decoder`` 都有对应的 :class:`State` 对象用来承载 ``encoder`` 的输出以及当前时刻之前的 ``decode`` 状态。
  
  :param encoder_output: 如果不为 ``None`` ，内部元素需要为 :class:`torch.Tensor`，默认其中第一维是 ``batch_size``
      维度
  :param encoder_mask: 如果部位 ``None``，内部元素需要为 :class:`torch.Tensor`，默认其中第一维是 ``batch_size``
      维度
  :param kwargs:
class_docstr_tok: ["\u6bcf\u4e2a","``","Decoder","``","\u90fd\u6709\u5bf9\u5e94\u7684",":","class",":","`","State","`","\u5bf9\u8c61\u7528\u6765\u627f\u8f7d","``","encoder","``","\u7684\u8f93\u51fa\u4ee5\u53ca\u5f53\u524d\u65f6\u523b\u4e4b\u524d\u7684","``","decode","``","\u72b6\u6001\u3002",":","param","encoder_output",":","\u5982\u679c\u4e0d\u4e3a","``","None","``","\uff0c\u5185\u90e8\u5143\u7d20\u9700\u8981\u4e3a",":","class",":","`","torch.Tensor","`","\uff0c\u9ed8\u8ba4\u5176\u4e2d\u7b2c\u4e00\u7ef4\u662f","``","batch_size","``","\u7ef4\u5ea6",":","param","encoder_mask",":","\u5982\u679c\u90e8\u4f4d","``","None","``","\uff0c\u5185\u90e8\u5143\u7d20\u9700\u8981\u4e3a",":","class",":","`","torch.Tensor","`","\uff0c\u9ed8\u8ba4\u5176\u4e2d\u7b2c\u4e00\u7ef4\u662f","``","batch_size","``","\u7ef4\u5ea6",":","param","kwargs",":"]
code: def __init__(
      self,
      encoder_output: Union[torch.Tensor, List, Tuple] = None,
      encoder_mask: Union[torch.Tensor, List, Tuple] = None,
      **kwargs,
  ):
      self.encoder_output = encoder_output
      self.encoder_mask = encoder_mask
      self._decode_length = 0
  
file_path: fastNLP/fastNLP/modules/torch/decoder/seq2seq_state.py
imports: from typing import Union, List, Tuple
  import torch
label_desc: Use image node_id 1 to create a new State object  with example: obj = State(encoder_output, encoder_mask)