Evaluation in batches

How can i evaluate test data in batches?

This is the evaluation code, i need to predict in batches. Please help

get predictions for test data

with torch.no_grad():
preds = model(test_seq.to(device), test_mask.to(device))
preds = preds.detach().cpu().numpy()

model’s performance

preds = np.argmax(preds, axis = 1)
print(classification_report(test_y, preds))