class_docstr: Lunar Multi-headed attention.
  See "Linformer: Self-Attention with Linear Complexity" for more details.
code: def _compute_pcontext(self, pquery, context, context_padding_mask):
      # N x B x D
      len, bsz, dim = context.size()
      if self.pc_proj is not None:
          c = self.pc_proj(context)
          # N x B x D -> N x B*H x K
          k = v = c.view(len, bsz * self.num_pheads, self.phead_dim)
      else:
          # N x B x D -> N x B*H x K
          k = self.pk_proj(context).view(
              len, bsz * self.num_pheads, self.phead_dim
          )
          v = self.pv_proj(context).view(
              len, bsz * self.num_pheads, self.phead_dim
          )
  
      # N x B*H x K -> B*H x K x N
      k = k.permute(1, 2, 0)
      # N x B*H x K -> B*H x N x K
      v = v.transpose(0, 1)
  
      plen = pquery.size(0)
      # L x B x D -> L x B*H x K
      pq = self.pq_proj(pquery).view(
          plen, bsz * self.num_pheads, self.phead_dim
      )
      # L x B*H x K -> B*H x L x K
      pq = pq.transpose(0, 1) * self.pscaling
      # B*H x L x N
      pqk = torch.bmm(pq, k)
      if context_padding_mask is not None:
          pqk = pqk.view(bsz, self.num_pheads, plen, len)
          pqk = pqk.masked_fill(
              context_padding_mask.unsqueeze(1)
              .unsqueeze(2)
              .to(torch.bool),
              float("-inf"),
          )
          pqk = pqk.view(bsz * self.num_pheads, plen, len)
  
      pqk = F.softmax(pqk, dim=-1)
      pqk = self.dropout_module(pqk)
      # B*H x L x K
      pc = torch.bmm(pqk, v)
      # B*H x L x K -> L x B*H x K -> L x B x D
      pc = pc.transpose(0, 1).contiguous().view(plen, bsz, dim)
      return pc
  
imports: import math
  from typing import Dict, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from fairseq import utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from fairseq.modules.fairseq_dropout import FairseqDropout
  from torch import nn, Tensor
label_desc: Use image node_id 5 for calling the LunarMultiheadAttention obj's underlying member method code with example usage: obj._compute_pcontext(pquery, context, context_padding_mask) and returns: pc