class_docstr: Machine translation model which supports bottleneck architecture,
  NLL, VAE, and MIM loss.
  
  Supported losses:
    1) nll - Conditional cross entropy (the usual NMT loss)
    2) mim - MIM learning framework. A latent variable model with good
                    reconstruction and compressed latent representation.
                    https://arxiv.org/pdf/2003.02645.pdf
    3) vae - VAE learning framework. A latent variable model which learns
                    good probability estimation over observations and
                    a regularized latent representation.
                    https://arxiv.org/pdf/1312.6114.pdf
class_docstr_tok: ["Machine","translation","model","which","supports","bottleneck","architecture",",","NLL",",","VAE",",","and","MIM","loss",".","Supported","losses",":","1",")","nll","-","Conditional","cross","entropy","(","the","usual","NMT","loss",")","2",")","mim","-","MIM","learning","framework",".","A","latent","variable","model","with","good","reconstruction","and","compressed","latent","representation",".","https",":","\/\/arxiv.org\/pdf\/2003.02645.pdf","3",")","vae","-","VAE","learning","framework",".","A","latent","variable","model","which","learns","good","probability","estimation","over","observations","and","a","regularized","latent","representation",".","https",":","\/\/arxiv.org\/pdf\/1312.6114.pdf"]
docstr: return_info - if True, returns loss, info_dict with additional information
                regarding the loss that can be logged
docstr_tok: ["return_info","-","if","True",",","returns","loss",",","info_dict","with","additional","information","regarding","the","loss","that","can","be","logged"]
code: def forward(self, src, src_mask, tgt, tgt_mask, timer=None):
      """
      return_info - if True, returns loss, info_dict with additional information
                    regarding the loss that can be logged
      """
      if self.validate_input_ids:
          # test src/tgt for id range (i.e., hellp in catching wrong tokenizer)
          self.test_encoder_ids(src, raise_error=True)
          self.test_decoder_ids(tgt, raise_error=True)
  
      if timer is not None:
          timer.start("encoder")
      enc_hiddens, enc_mask = self.encoder(
          input_ids=src,
          encoder_mask=src_mask,
          return_mask=True,
      )
  
      # build posterior distribution q(x|z)
      z, z_mean, z_logv = self.encode_latent(hidden=enc_hiddens)
      z_mask = enc_mask
  
      if timer is not None:
          timer.stop("encoder")
  
      if timer is not None:
          timer.start("decoder")
  
      # decoding cross attention context
      context_hiddens = self.latent2hidden(z)
  
      tgt_hiddens = self.decoder(
          input_ids=tgt,
          decoder_mask=tgt_mask,
          encoder_embeddings=context_hiddens,
          encoder_mask=enc_mask,
      )
  
      # build decoding distribution
      tgt_log_probs = self.log_softmax(hidden_states=tgt_hiddens)
  
      if timer is not None:
          timer.stop("decoder")
  
      return z, z_mean, z_logv, z_mask, tgt_log_probs
  
imports: from typing import Dict, Optional
  import numpy
  import torch
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import NLLLoss
  from nemo.collections.nlp.models.machine_translation.mt_enc_dec_config import MTBottleneckModelConfig
  from nemo.collections.nlp.models.machine_translation.mt_enc_dec_model import MTEncDecModel
  from nemo.core.classes.common import typecheck
  from nemo.utils import timers
label_desc: Use image node_id 7 for calling the MTBottleneckModel obj's underlying member method code with example usage: obj.forward(src, src_mask, tgt, tgt_mask, timer) and returns: z,  z_mean,  z_logv,  z_mask,  tgt_log_probs