class_docstr: Parameters
  ----------
  supps_size: The encoding dimension of the support series.
  q_size: The encoding dimension of the query series.
  embed_size: The embedding dimension for keys, queries and values.
  num_heads: The number of attention heads
class_docstr_tok: ["Parameters","--","--","--","--","--","supps_size",":","The","encoding","dimension","of","the","support","series",".","q_size",":","The","encoding","dimension","of","the","query","series",".","embed_size",":","The","embedding","dimension","for","keys",",","queries","and","values",".","num_heads",":","The","number","of","attention","heads"]
code: def __init__(self, supps_size: int, q_size: int, num_heads: int = 1):
      super().__init__()
      assert (
          q_size % num_heads == 0
      ), "Embedding dimension must be 0 modulo number of heads."
  
      self.supps_embed_size = supps_size
      self.num_heads = num_heads
      self.multihead_attn = nn.MultiheadAttention(
          embed_dim=q_size,
          kdim=self.supps_embed_size,
          vdim=self.supps_embed_size,
          num_heads=num_heads,
          batch_first=True,
      )
  
file_path: gluonts/src/gluonts/nursery/few_shot_prediction/src/meta/models/EcDc/components/attention.py
imports: from typing import Union, Tuple
  from abc import ABC, abstractmethod
  import torch
  from torch import nn
  from meta.data.batch import SeriesBatch
label_desc: Use image node_id 1 to create a new MultiHeadSupportSetQueryAttention object from inherited base classes: SupportSetQueryAttention with example: obj = MultiHeadSupportSetQueryAttention(supps_size, q_size, num_heads)