Have you tried something like this?
outputs = []
for input_batch in dataloader:
      output_batch = model(input_batch) #torch Tensor of shape (32, num_classes)
      outputs.append(output_batch)
print(outputs.shape) #Torch Tensor of shape (number of query images, num_classes)