code: def get_prototypes(embeddings, targets, num_classes):
      """Compute the prototypes (the mean vector of the embedded training/support
      points belonging to its class) for each classes in the task.
  
      Parameters
      ----------
      embeddings : `torch.FloatTensor` instance
          A tensor containing the embeddings of the support points. This tensor
          has shape `(batch_size, num_examples, embedding_size)`.
  
      targets : `torch.LongTensor` instance
          A tensor containing the targets of the support points. This tensor has
          shape `(batch_size, num_examples)`.
  
      num_classes : int
          Number of classes in the task.
  
      Returns
      -------
      prototypes : `torch.FloatTensor` instance
          A tensor containing the prototypes for each class. This tensor has shape
          `(batch_size, num_classes, embedding_size)`.
      """
      batch_size, embedding_size = embeddings.size(0), embeddings.size(
          -1
      )
  
      num_samples = get_num_samples(
          targets, num_classes, dtype=embeddings.dtype
      )
      num_samples.unsqueeze_(-1)
      num_samples = torch.max(num_samples, torch.ones_like(num_samples))
  
      prototypes = embeddings.new_zeros(
          (batch_size, num_classes, embedding_size)
      )
      indices = targets.unsqueeze(-1).expand_as(embeddings)
      prototypes.scatter_add_(1, indices, embeddings).div_(num_samples)
  
      return prototypes
  
imports: import torch
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: get_prototypes(embeddings, targets, num_classes) and returns: prototypes