class_docstr: TransformerDecoder layer which inherits from TransformerEncoderLayer.
class_docstr_tok: ["TransformerDecoder","layer","which","inherits","from","TransformerEncoderLayer","."]
code: def __init__(
      self,
      ninp,
      nhead,
      nhid,
      dropout,
      is_moe=False,
      num_local_experts=1,
  ):
      super().__init__(
          ninp,
          nhead,
          nhid,
          dropout,
          is_moe=is_moe,
          num_local_experts=num_local_experts,
      )
      self.src_mask = None
  
imports: import math
  import torch
  import torch.nn
  from fairscale.nn.moe.moe_layer import MOELayer
  from fairscale.nn.moe.top2gate import Top2Gate
label_desc: Use image node_id 1 to create a new TransformerDecoderLayer object from inherited base classes: TransformerEncoderLayer with example: obj = TransformerDecoderLayer(ninp, nhead, nhid, dropout, is_moe, num_local_experts)