class_docstr: Train two models for a task and its duality jointly.
  This class uses RNN arch, but can be extended to take arch as an arument.
  This class takes translation as a task, but the framework is intended
  to be general enough to be applied to other tasks as well.
class_docstr_tok: ["Train","two","models","for","a","task","and","its","duality","jointly",".","This","class","uses","RNN","arch",",","but","can","be","extended","to","take","arch","as","an","arument",".","This","class","takes","translation","as","a","task",",","but","the","framework","is","intended","to","be","general","enough","to","be","applied","to","other","tasks","as","well","."]
code: def add_args(parser):
      rnn.RNNModel.add_args(parser)
      parser.add_argument(
          "--unsupervised-dual",
          default=False,
          action="store_true",
          help="Train with dual loss from monolingual data.",
      )
      parser.add_argument(
          "--supervised-dual",
          default=False,
          action="store_true",
          help="Train with dual loss from parallel data.",
      )
  
file_path: translate/pytorch_translate/dual_learning/dual_learning_models.py
imports: import logging
  import torch.nn
  from fairseq import checkpoint_utils
  from fairseq.models import BaseFairseqModel, register_model
  from pytorch_translate import rnn
  from pytorch_translate.rnn import base_architecture, LSTMSequenceEncoder, RNNDecoder, RNNEncoder, RNNModel
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
label_desc: Use image node_id 2 for calling the RNNDualLearningModel obj's underlying member method code with example usage: obj.add_args(parser) without return types