code: def forward(self, query, key, value):
      # query: [*, query_entries, in_channels]
      # key: [*, key_entries, in_channels]
      # value: [*, key_entries, in_channels]
      # Output: [*, query_entries, out_channels]
  
      assert query.dim() == key.dim() == value.dim() >= 2
      assert query.size(-1) == key.size(-1) == value.size(-1)
      assert key.size(-2) == value.size(-2)
  
      query = self.lin_q(query)
      key = self.lin_k(key)
      value = self.lin_v(value)
  
      # query: [*, heads, query_entries, out_channels // heads]
      # key: [*, heads, key_entries, out_channels // heads]
      # value: [*, heads, key_entries, out_channels // heads]
      size = query.size()[:-2]
      out_channels_per_head = self.out_channels // self.heads
  
      query_size = size + (
          query.size(-2),
          self.heads,
          out_channels_per_head,
      )
      query = query.view(query_size).transpose(-2, -3)
  
      key_size = size + (
          key.size(-2),
          self.heads,
          out_channels_per_head,
      )
      key = key.view(key_size).transpose(-2, -3)
  
      value_size = size + (
          value.size(-2),
          self.heads,
          out_channels_per_head,
      )
      value = value.view(value_size).transpose(-2, -3)
  
      # Output: [*, heads, query_entries, out_channels // heads]
      out = self.compute_attention(query, key, value)
      # Output: [*, query_entries, heads, out_channels // heads]
      out = out.transpose(-3, -2).contiguous()
      # Output: [*, query_entries, out_channels]
      out = out.view(size + (query.size(-2), self.out_channels))
  
      return out
  
imports: import math
  from typing import Optional
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.nn import Parameter
  from torch_geometric.nn.conv import MessagePassing
  from torch_geometric.nn.conv.gcn_conv import gcn_norm
  from torch_geometric.nn.inits import kaiming_uniform, uniform
  from torch_geometric.typing import Adj, OptPairTensor, OptTensor, SparseTensor
label_desc: Use image node_id 3 for calling the MultiHead obj's underlying member method code with example usage: obj.forward(query, key, value) and returns: out