Skip to content

Commit

Permalink
(fix): Ensure survival tensors are moved to CPU before converting to …
Browse files Browse the repository at this point in the history
…NumPy arrays.
  • Loading branch information
arnor-sigurdsson committed Jan 23, 2025
1 parent 435e55b commit 655ba6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def predict_survival_wrapper_with_labels(
)

else:
risk_scores = model_outputs.numpy()
risk_scores = model_outputs.cpu().numpy()

baseline_hazard = output_object.baseline_hazard
unique_times = output_object.baseline_unique_times
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def save_survival_evaluation_results_wrapper(
)

else:
risk_scores = model_outputs.numpy()
risk_scores = model_outputs.cpu().numpy()

unique_times, baseline_hazard = estimate_baseline_hazard(
times=times,
Expand Down

0 comments on commit 655ba6f

Please sign in to comment.