class_docstr: Transformer encoder-decoder model.
      
class_docstr_tok: ["Transformer","encoder-decoder","model","."]
docstr: Returns the attention mask for the output of the encoder.
  Required for fixed-size bottleneck models.
docstr_tok: ["Returns","the","attention","mask","for","the","output","of","the","encoder",".","Required","for","fixed-size","bottleneck","models","."]
code: def get_hiddens_mask(self, enc_attn_mask):
      """
      Returns the attention mask for the output of the encoder.
      Required for fixed-size bottleneck models.
      """
      if self.encoder is not None and isinstance(
          self.encoder, MegatronPerceiverEncoderModule
      ):
          # Attention mask is expected to be of shape [B x S]
          hiddens_mask = torch.ones(
              enc_attn_mask.size(0), self.hidden_steps
          ).to(enc_attn_mask.device)
      else:
          hiddens_mask = enc_attn_mask
  
      return hiddens_mask
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/megatron_encoder_decoder.py
imports: from ast import Mod
  import torch
  from nemo.collections.nlp.modules.common.megatron.hiddens import MegatronHiddensModule
  from nemo.collections.nlp.modules.common.megatron.megatron_perceiver_encoders import MegatronPerceiverEncoderModule
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
label_desc: Use image node_id 2 for calling the MegatronTransformerEncoderDecoderModule obj's underlying member method code with example usage: obj.get_hiddens_mask(enc_attn_mask) and returns: hiddens_mask