Problem in understanding the test phase in Few-shot learning

I am studying few-shot learning ([1703.05175] Prototypical Networks for Few-shot Learning) and its source code. But the point is that the query set and the support sets in the test phase does not make sense to me. I am trying to understand why the test phase or validation phase uses label data for the query set. It is very different from classification or semi-supervised learning.

When we train the encoder, we use l2-distance, a support set, and a query set to train the network. The samples in both sets are chosen based on their labels (k-way+n-shot setting). In the test phase, we have different labels from the train set. We choose the support and query sets the same way as the training phase without updating the encoder weights. But the query set is chosen based on label.

I do not understand why in the test phase we use the query set and try to predict the label based on distance from just x-way. Should not we calculate the prototypes of each label and calculate the distance of query images with all labels in the test phase? It makes more sense than calculating the distance of query samples (without considering them based on their labels). Also, the same in the training phase. no distance among all labels’ prototypes.

Again, testing based on support and query set does not make sense in the test phase.