class_docstr: Attention-Pooling module that estimates the attention score.
  
  Args:
      input_dim (int): Input feature dimension.
      att_dim (int): Attention Tensor dimension.
class_docstr_tok: ["Attention-Pooling","module","that","estimates","the","attention","score",".","Args",":","input_dim","(","int",")",":","Input","feature","dimension",".","att_dim","(","int",")",":","Attention","Tensor","dimension","."]
docstr: Apply attention and pooling.
  
  Args:
      x (torch.Tensor): Input Tensor with dimensions `(batch, time, feature_dim)`.
  
  Returns:
      (torch.Tensor): Attention score with dimensions `(batch, att_dim)`.
docstr_tok: ["Apply","attention","and","pooling",".","Args",":","x","(","torch.Tensor",")",":","Input","Tensor","with","dimensions","`","(","batch",",","time",",","feature_dim",")","`",".","Returns",":","(","torch.Tensor",")",":","Attention","score","with","dimensions","`","(","batch",",","att_dim",")","`","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """Apply attention and pooling.
  
      Args:
          x (torch.Tensor): Input Tensor with dimensions `(batch, time, feature_dim)`.
  
      Returns:
          (torch.Tensor): Attention score with dimensions `(batch, att_dim)`.
      """
  
      att = self.linear1(x)  # (batch, time, 1)
      att = att.transpose(2, 1)  # (batch, 1, time)
      att = nn.functional.softmax(att, dim=2)
      x = torch.matmul(att, x).squeeze(1)  # (batch, input_dim)
      x = self.linear2(x)  # (batch, att_dim)
      return x
  
file_path: audio/src/torchaudio/models/squim/subjective.py
imports: from typing import Tuple
  import torch
  import torch.nn
  import torchaudio
label_desc: Use image node_id 2 for calling the AttPool obj's underlying member method code with example usage: obj.forward(x) and returns: x