def forward(self, x: torch.Tensor, mask: torch.Tensor = None) -> torch.Tensor:
        """
        Forward call.

        Args:
            x: tensor of size
                (batch_size, history_len, feature_size)
            mask: mask to use

        Returns:
            pooling result
        """
        batch_size, history_len, feature_size = x.shape

        x = x.view(batch_size, history_len, -1)
        x_a = x.transpose(1, 2)
        x_attn = (self.attention_pooling(x_a) * x_a).transpose(1, 2)
        x_attn = x_attn.sum(1, keepdim=True)

        return x_attn

        Forward call.

        Args:
            x: tensor of size
                (batch_size, history_len, feature_size)
            mask: mask to use

        Returns:
            pooling result
        
catalyst/contrib/layers/lama.py