code: def valid(loader, device, model):
      model.eval()
      correct = 0
      total = 0
      with torch.no_grad():
          for batch_idx, (inputs, targets) in enumerate(loader):
              inputs, targets = inputs.to(device), targets.to(device)
              outputs = model(inputs)
  
              _, predicted = outputs.max(1)
              total += targets.size(0)
              correct += predicted.eq(targets).sum().item()
  
      return 100.0 * (1 - correct / total)
  
file_path: orion/examples/tutorials/code_2_hyperband_checkpoint.py
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.optim
  import torchvision
  import torchvision.models
  import torchvision.transforms
  from torch.utils.data import SubsetRandomSampler
  from orion.client import build_experiment
label_desc: Use image node_id 5 for calling a global function with example usage: valid(loader, device, model) and returns: unknown