Skip to content

Commit

Permalink
Fix for ContextMMDDriftTorch typing issue with numpy >=1.22 (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascillitoe authored May 26, 2022
1 parent 4c44e9d commit 32d79cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alibi_detect/cd/pytorch/context_aware.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def _pick_lam(self, lams: torch.Tensor, K: torch.Tensor, L: torch.Tensor, n_fold
K, L = K[perm][:, perm], L[perm][:, perm]
losses = torch.zeros_like(lams, dtype=torch.float).to(K.device)
for fold in range(n_folds):
inds_oof = np.arange(n)[(fold*fold_size):((fold+1)*fold_size)]
inds_if = np.setdiff1d(np.arange(n), inds_oof)
inds_oof = list(np.arange(n)[(fold*fold_size):((fold+1)*fold_size)])
inds_if = list(np.setdiff1d(np.arange(n), inds_oof))
K_if, L_if = K[inds_if][:, inds_if], L[inds_if][:, inds_if]
n_if = len(K_if)
L_inv_lams = torch.stack(
Expand Down

0 comments on commit 32d79cd

Please sign in to comment.