class_docstr: Abstract class for decoders.
  
  Args:
      attentional (bool): The decoder returns non-empty attention.
class_docstr_tok: ["Abstract","class","for","decoders",".","Args",":","attentional","(","bool",")",":","The","decoder","returns","non-empty","attention","."]
docstr: Alternate constructor.
  
  Subclasses should override this method.
docstr_tok: ["Alternate","constructor",".","Subclasses","should","override","this","method","."]
code: def from_opt(cls, opt, embeddings):
      """Alternate constructor.
  
      Subclasses should override this method.
      """
  
      raise NotImplementedError
  
imports: import torch
  import torch.nn
  from onmt.modules.stacked_rnn import StackedLSTM, StackedGRU
  from onmt.modules import context_gate_factory, GlobalAttention
  from onmt.utils.rnn_factory import rnn_factory
label_desc: Use image node_id 2 for calling the DecoderBase obj's underlying member method code with example usage: obj.from_opt(cls, opt, embeddings) without return types