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: Contains attention weights from last forward call.
docstr_tok: ["Contains","attention","weights","from","last","forward","call","."]
code: def attention_weights(self) -> Optional[torch.Tensor]:
      """
      Contains attention weights from last forward call.
      """
      return self._attention_weights
  
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 2 for calling the TransposeMultiheadAttention obj's underlying member method code with example usage: obj.attention_weights() and returns: self