code: def forward(self, query, key, value, mask=None, attention_map=None):
      if mask is not None:
          mask = mask.unsqueeze(1)
      nbatches = paddle.shape(query)[0]
  
      query, key, value = [
          paddle.transpose(
              l(x).reshape([nbatches, -1, self.h, self.d_k]),
              [0, 2, 1, 3],
          )
          for l, x in zip(self.linears, (query, key, value))
      ]
  
      x, attention_map = attention(
          query,
          key,
          value,
          mask=mask,
          dropout=self.dropout,
          attention_map=attention_map,
      )
  
      x = paddle.reshape(
          paddle.transpose(x, [0, 2, 1, 3]),
          [nbatches, -1, self.h * self.d_k],
      )
  
      return self.linears[-1](x), attention_map
  
imports: import copy
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling the MultiHeadedAttention obj's underlying member method code with example usage: obj.forward(query, key, value, mask, attention_map) and returns: self,  attention_map