class_docstr: Parallel self-attention layer abstract class.
  
  Self-attention layer takes input with size [s, b, h]
  and returns output of the same size.
class_docstr_tok: ["Parallel","self-attention","layer","abstract","class",".","Self-attention","layer","takes","input","with","size","[","s",",","b",",","h","]","and","returns","output","of","the","same","size","."]
code: def _allocate_memory(
      self, inference_max_sequence_len, batch_size, dtype, device
  ):
      return torch.empty(
          inference_max_sequence_len,
          batch_size,
          self.num_attention_heads_per_partition,
          self.hidden_size_per_attention_head,
          dtype=dtype,
          device=device,
      )
  
imports: import math
  import torch
  import torch.nn.functional
  from einops import rearrange, repeat
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, InfusedAdapterConfig, LoraKQVAdapterConfig, LoraKQVAdapterWeightTyingConfig, LoraKVAdapterConfig, LoraQAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.fused_softmax import MatchedScaleMaskSoftmax
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.position_embedding import XPOSPositionEmbedding
  from nemo.collections.nlp.modules.common.megatron.position_embedding.rotary_position_embedding import apply_rotary_pos_emb
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, _cast_if_autocast_enabled, attention_mask_func
  from nemo.core import adapter_mixins
label_desc: Use image node_id 3 for calling the ParallelAttention obj's underlying member method code with example usage: obj._allocate_memory(inference_max_sequence_len, batch_size, dtype, device) and returns: torch