code: def forward(self, net: Tensor) -> Tensor:
      weights = self.projection(net)
      weights = F.softmax(weights, dim=1).transpose(-1, -2)
      net = torch.matmul(weights, net)
      if self.out_dim > 1:
          return net
      return net.squeeze(-2)
  
file_path: carefree-learn/cflearn/modules/blocks/mixed_stacks/poolers.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from typing import List
  from typing import Optional
  from torch.nn import Module
  from ..customs import Linear
label_desc: Use image node_id 2 for calling the SequencePooler obj's underlying member method code with example usage: obj.forward(net) and returns: net, net