gitlab.com
  
  
    promach/Pruning-CNN/blob/master/SqueezeNet-Pruning/finetune.py#L267


def test_single(model,test_single_path):
	test_single_loader = dataset.test_loader(test_single_path)
	model.eval()
	time_ = 0 
	for i, (batch, label) in enumerate(test_single_loader):
		batch = batch.cuda()
		t0 = time.time()
		output = model(Variable(batch))
		t1 = time.time()			
		time_ += t1-t0
		pred = output.data.max(1)[1]
	print ("Avg time taken per image is(over 800 Images..)  ", time_/800)
def get_args():
	parser = argparse.ArgumentParser()
	parser.add_argument("--model", type = str, default = "model_prunned")
	parser.add_argument("--train", dest="train", action="store_true")
	parser.add_argument("--prune", dest="prune", action="store_true")
	parser.add_argument("--run", dest="run",action="store_true")
	parser.add_argument("--flops", dest="flops",action="store_true")
	parser.add_argument("--train_path", type = str, default = "train")
	parser.add_argument("--test_path", type = str, default = "test")



  
  
    
    
  
  


If you have ground truth then compare and print accuracy as well (Optional)