class_docstr: A task for training primal model and dual models jointly.
  It takes:
      - unlabelled source (aka source monolingual data for translation task),
      - unlabelled target (aka target monolingual data for translation task),
      - labelled (source, target) (aka parallel data for translation task),
class_docstr_tok: ["A","task","for","training","primal","model","and","dual","models","jointly",".","It","takes",":","-","unlabelled","source","(","aka","source","monolingual","data","for","translation","task",")",",","-","unlabelled","target","(","aka","target","monolingual","data","for","translation","task",")",",","-","labelled","(","source",",","target",")","(","aka","parallel","data","for","translation","task",")",","]
code: def _build_optimizer(self, model):
      if self.args.fp16:
          if torch.cuda.get_device_capability(0)[0] < 7:
              print(
                  "| WARNING: your device does NOT support faster training "
                  "with --fp16, please switch to FP32 which is likely to be"
                  " faster"
              )
          params = list(
              filter(lambda p: p.requires_grad, model.parameters())
          )
          self._optimizer = optim.FP16Optimizer.build_optimizer(
              self.args, params
          )
      else:
          if torch.cuda.get_device_capability(0)[0] >= 7:
              print(
                  "| NOTICE: your device may support faster training with --fp16"
              )
          self._optimizer = optim.build_optimizer(
              self.args, model.parameters()
          )
      return self._optimizer
  
imports: from collections import OrderedDict
  import torch
  from fairseq import optim, utils
  from fairseq.criterions import CRITERION_REGISTRY
  from fairseq.data import LanguagePairDataset, RoundRobinZipDatasets
  from fairseq.tasks import LegacyFairseqTask, register_task
  from pytorch_translate.data import dictionary, utils
  from pytorch_translate.dual_learning import dual_learning_models
  from pytorch_translate.dual_learning.dual_learning_criterion import UnsupervisedCriterion
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
  from pytorch_translate.weighted_criterions import WeightedLabelSmoothedCrossEntropyCriterion
label_desc: Use image node_id 3 for calling the DualLearningTask obj's underlying member method code with example usage: obj._build_optimizer(model) and returns: self