import torch


def get_idxs(results, test_targets, device):
  """
  Args:
      results (tensor): predictions
      test_targets (tensor): Ground truth labels
  Returns:
      miss_index: index of misclassifier images
      hit_index: index of correctly classifier images
  """
  miss_index = torch.where((results.argmax(dim=1) == torch.tensor(test_targets).to(device)) == False)[0]
  hit_index = torch.where((results.argmax(dim=1) == torch.tensor(test_targets).to(device)) == True)[0]
  return((miss_index, hit_index))