Skip to content

Commit

Permalink
fix: tensor conversion with gpu
Browse files Browse the repository at this point in the history
The conversion of GPU tensors to numpy arrays caused an error, which should now be fixed.
  • Loading branch information
lucasczz committed Aug 30, 2023
1 parent 50a240d commit 84fca25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deep_river/utils/tensor_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def output2proba(
else:
preds = torch.sigmoid(preds)

preds_np = preds.detach().numpy()
preds_np = preds.numpy(force=True)
if preds_np.shape[1] == 1:
preds_np = np.hstack((preds_np, 1 - preds_np))
n_unobserved_classes = preds_np.shape[1] - len(classes)
Expand Down

0 comments on commit 84fca25

Please sign in to comment.