class_docstr: Wrapper for nn.MultiheadAttention which first transposes the input tensor
  from (batch_size, seq_len, feature_dim) to (seq_length, batch_size, feature_dim),
  then applies the attention and transposes the attention outputs back to the input
  shape.
class_docstr_tok: ["Wrapper","for","nn.MultiheadAttention","which","first","transposes","the","input","tensor","from","(","batch_size",",","seq_len",",","feature_dim",")","to","(","seq_length",",","batch_size",",","feature_dim",")",",","then","applies","the","attention","and","transposes","the","attention","outputs","back","to","the","input","shape","."]
docstr: Args:
      feature_dim (int): attention embedding dimension
      num_heads (int): number of attention heads
docstr_tok: ["Args",":","feature_dim","(","int",")",":","attention","embedding","dimension","num_heads","(","int",")",":","number","of","attention","heads"]
code: def __init__(self, feature_dim: int, num_heads: int = 1):
      """
      Args:
          feature_dim (int): attention embedding dimension
          num_heads (int): number of attention heads
      """
      super().__init__()
      self._attention = nn.MultiheadAttention(
          embed_dim=feature_dim, num_heads=num_heads
      )
      self._attention_weights = None
  
imports: from typing import List, Optional, Tuple
  import torch
  from pytorchvideo.layers.utils import set_attributes
  from torch import nn
  from torch.nn.utils.rnn import pack_padded_sequence
label_desc: Use image node_id 1 to create a new TransposeMultiheadAttention object from inherited base classes: nn with example: obj = TransposeMultiheadAttention(feature_dim, num_heads)