docstr: Evaluate current model with a batch of tasks. Different from 'train_one_iter',
  this method does not update meta-model.
  
  Args:
      data_batch: a batch of tasks, each task contains support set and query set
  
  Returns:
      average MSE loss on query set
docstr_tok: ["Evaluate","current","model","with","a","batch","of","tasks",".","Different","from","'train_one_iter","'",",","this","method","does","not","update","meta-model",".","Args",":","data_batch",":","a","batch","of","tasks",",","each","task","contains","support","set","and","query","set","Returns",":","average","MSE","loss","on","query","set"]
code: def evaluate_one_iter(self, data_batch):
      """
      Evaluate current model with a batch of tasks. Different from 'train_one_iter',
      this method does not update meta-model.
  
      Args:
          data_batch: a batch of tasks, each task contains support set and query set
  
      Returns:
          average MSE loss on query set
      """
      (
          x_support_set,
          y_support_set,
          x_query_set,
          y_query_set,
      ) = data_batch
  
      x_support_set = x_support_set.to(self.device)
      y_support_set = y_support_set.to(self.device)
      x_query_set = x_query_set.to(self.device)
      y_query_set = y_query_set.to(self.device)
  
      self.model.zero_grad()
      test_losses = []
      for x_support, y_support, x_query, y_query in zip(
          x_support_set, y_support_set, x_query_set, y_query_set
      ):
          model_weights = self.model.get_weights()
  
          for num_step in range(self.num_updates_per_iter):
              support_loss = self._caculate_loss(
                  x_support, y_support, model_weights
              )
  
              model_weights = self._inner_loop_update(
                  loss=support_loss,
                  weights=model_weights,
                  use_second_order=self.second_order,
                  current_update_step=num_step,
              )
  
          with torch.no_grad():
              query_loss = self._caculate_loss(
                  x_query, y_query, model_weights
              )
  
          test_losses.append(query_loss.cpu().item())
  
      test_loss = sum(test_losses) / len(test_losses)
  
      return test_loss
  
file_path: PARL/benchmark/torch/maml++/maml_algorithm.py
imports: import torch
  from torch import nn
  from torch import optim
  import torch.nn.functional
  import numpy
  import parl
label_desc: Use image node_id 3 for calling the MAML obj's underlying member method code with example usage: obj.evaluate_one_iter(data_batch) and returns: test_loss