code: def forward(self, Q, K, V):
      q = self.q_net(Q)
      k = self.k_net(K)
      v = self.v_net(V)
  
      attn = torch.einsum("ijk,ilk->ijl", q, k)
      attn = attn.to(Q.device)
      attn_prob = torch.softmax(attn, dim=-1)
  
      attn_vec = torch.einsum("ijk,ikl->ijl", attn_prob, v)
  
      return attn_vec
  
file_path: qlib/qlib/rl/order_execution/network.py
imports: from __future__ import annotations
  from typing import List, Tuple, cast
  import torch
  import torch.nn
  from tianshou.data import Batch
  from qlib.typehint import Literal
  from .interpreter import FullHistoryObs
label_desc: Use image node_id 2 for calling the Attention obj's underlying member method code with example usage: obj.forward(Q, K, V) and returns: attn_vec