Skip to content

Commit

Permalink
Fix error in decoupled_mobo tutorial due to torch/numpy issues (#2550)
Browse files Browse the repository at this point in the history
Summary:
This started failing in CI recently, presumably due to some incompatibilities between numpy and torch as used within `np.cumsum` introduced in recent torch commits. This converts the tensors in question to np arrays to avoid this issue.

Pull Request resolved: #2550

Reviewed By: saitcakmak

Differential Revision: D63263300

Pulled By: Balandat

fbshipit-source-id: 899d7ae0c91ff08d9d2850ee1d78c74d87eb57bc
  • Loading branch information
Balandat authored and facebook-github-bot committed Sep 23, 2024
1 parent 161a9a8 commit 02bb565
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tutorials/decoupled_mobo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,9 @@
"log_hv_difference_rnd = np.log10(problem.max_hv - np.asarray(hvs_random))\n",
"\n",
"fig, ax = plt.subplots(1, 1, figsize=(8, 6))\n",
"running_cost_random = np.cumsum(cost_random.cpu()[N_INIT-1:])\n",
"running_cost_qnehvi = np.cumsum(cost_qnehvi.cpu()[N_INIT-1:])\n",
"running_cost_hvkg = np.cumsum(cost_hvkg.cpu()[N_INIT-1:])\n",
"running_cost_random = np.cumsum(cost_random.cpu().numpy()[N_INIT-1:])\n",
"running_cost_qnehvi = np.cumsum(cost_qnehvi.cpu().numpy()[N_INIT-1:])\n",
"running_cost_hvkg = np.cumsum(cost_hvkg.cpu().numpy()[N_INIT-1:])\n",
"ax.errorbar(\n",
" running_cost_random,\n",
" log_hv_difference_rnd[: len(running_cost_random)],\n",
Expand Down

0 comments on commit 02bb565

Please sign in to comment.