text: '''Test CIFAR10 with PyTorch.'''
  from __future__ import print_function
  
  import glob
  
  import torch
  import torch.nn as nn
  import torch.optim as optim
  import torch.nn.functional as F
  import torch.backends.cudnn as cudnn
  
  import torchvision
  import torchvision.transforms as transforms
  
  import os
  import argparse
  
  from models import *
  from utils import progress_bar
  from torch.autograd import Variable
  
  torch.nn.Module.dump_patches = True
  
  parser = argparse.ArgumentParser(description='PyTorch CIFAR10 Training')
  parser.add_argument('--model', action='append', help='Specify model to test')
  parser.add_argument('--suppress-errors', action='store_true')
  parser.add_argument('--dataset', choices=('cifar10', 'cifar100'), help='Dataset to train and validate on.', default='cifar10')
  args = parser.parse_args()
  
  use_cuda = torch.cuda.is_available()
  best_acc = 0  # best test accuracy
  start_epoch = 0  # start from epoch 0 or last checkpoint epoch
  
  transform_test = transforms.Compose([
      transforms.ToTensor(),
      transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
  ])
  data_root = '/data/unagi0/kamata'
  if args.dataset == 'cifar10':
      testset = torchvision.datasets.CIFAR10(root=data_root, train=False, download=True, transform=transform_test)
  elif args.dataset == 'cifar100':
      testset = torchvision.datasets.CIFAR100(root=data_root, train=False, download=True, transform=transform_test)
  
  testloader = torch.utils.data.DataLoader(testset, batch_size=512, shuffle=False, num_workers=4)
  
  criterion = nn.CrossEntropyLoss()
  
  # Load checkpoint.
  print('==> Resuming from checkpoint..')
  assert os.path.isdir('checkpoint'), 'Error: no checkpoint directory found!'
  
  def test(epoch):
      global best_acc
      net.eval()
      test_loss = 0
      correct = 0
      total = 0
      for batch_idx, (inputs, targets) in enumerate(testloader):
          with torch.no_grad():
              if use_cuda:
                  inputs, targets = inputs.cuda(), targets.cuda()
              inputs, targets = Variable(inputs), Variable(targets)
              outputs = net(inputs)
              loss = criterion(outputs, targets)
  
              test_loss += loss.item() * targets.size(0)
              _, predicted = torch.max(outputs.data, 1)
              total += targets.size(0)
              correct += predicted.eq(targets.data).cpu().sum()
  
          progress_bar(batch_idx, len(testloader), 'Loss: %.3f | Acc: %.3f%% (%d/%d)'
              % (test_loss/total, 100.*correct/total, correct, total))
      return ' '
  
  for pattern in args.model:
    for model in sorted(glob.iglob(pattern), reverse=True):
      print('Reading from model', model)
      checkpoint = torch.load(model)
      net = checkpoint['net']
      best_acc = checkpoint.get('acc', 0)
      start_epoch = checkpoint.get('epoch', 0)
      if use_cuda:
          net.cuda()
          net = torch.nn.DataParallel(net, device_ids=range(torch.cuda.device_count()))
          cudnn.benchmark = True
      if args.suppress_errors:
        try:
          print(test(0))
        except AssertionError as e:
          print('The model may be malformed.')
          print(e)
      else:
        print(test(0))
  