class_docstr: An architecture to jointly train primal model and dual model by leveraging
  distribution duality, which exist for both parallel data and monolingual
  data.
class_docstr_tok: ["An","architecture","to","jointly","train","primal","model","and","dual","model","by","leveraging","distribution","duality",",","which","exist","for","both","parallel","data","and","monolingual","data","."]
code: def max_positions(self):
      return {
          "primal_source": (
              self.models["primal"].encoder.max_positions(),
              self.models["primal"].decoder.max_positions(),
          ),
          "dual_source": (
              self.models["dual"].encoder.max_positions(),
              self.models["dual"].decoder.max_positions(),
          ),
          "primal_parallel": (
              self.models["primal"].encoder.max_positions(),
              self.models["primal"].decoder.max_positions(),
          ),
          "dual_parallel": (
              self.models["dual"].encoder.max_positions(),
              self.models["dual"].decoder.max_positions(),
          ),
      }
  
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 3 for calling the DualLearningModel obj's underlying member method code with example usage: obj.max_positions() and returns: dict