Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. model.eval()
  2. targets = []
  3. preds = []
  4. indices = np.arange(len(test_dataset))
  5. for i in tqdm(range(0, len(test_dataset), batch_size)):
  6.     fields, target = acc_batch(test_dataset, i, batch_size, indices)
  7.     fields, target = fields.to(device), target.to(device)
  8.     y = model(fields).cpu().data.numpy()
  9.     for _y in y:
  10.         preds.append(_y)
  11.     t = target.cpu().data.numpy()
  12.     for _t in t:
  13.         targets.append(_t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement