class_docstr: A Luong-style attention that also includes the inner product of targets-lookup.
code: def forward_with_attention_vec(
      self,
      *,
      memories: torch.Tensor,
      memories_length: torch.Tensor,
      lookup_vectors: torch.Tensor,
  ):
      attention = self.get_attention_vector(
          lookup_vectors, memories, memories_length
      )  # [B, max-out-len, max-inp-len]
  
      contexts = torch.einsum(
          "blq,bqh->blh", attention, memories
      )  # [B, max-out-len, H]
      hc = torch.cat(
          (contexts, lookup_vectors), dim=-1
      )  # [B, max-out-len, H]
      return torch.tanh(self.__Wout(hc)), attention
  
file_path: ptgnn/ptgnn/neuralmodels/sequence/luongattention.py
imports: import math
  import torch
  from torch import nn
label_desc: Use image node_id 3 for calling the LuongAttentionModule obj's underlying member method code with example usage: obj.forward_with_attention_vec() and returns: torch,  attention