code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      weight = self.softmax(torch.mul(x, self.alpha))
      out = torch.sum(torch.mul(x, weight), dim=self.pool_dim)
      return out
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the AutoPool obj's underlying member method code with example usage: obj.forward(x) and returns: out