Skip to content

Commit

Permalink
Numpy deprecation warning (#2037)
Browse files Browse the repository at this point in the history
Summary:
This gets rid of the following warning: `DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future.`

Pull Request resolved: #2037

Reviewed By: Balandat

Differential Revision: D49992423

Pulled By: dme65

fbshipit-source-id: 885f2a43c758e0a0cab5cbd5111a1a90fcc73d99
  • Loading branch information
dme65 authored and facebook-github-bot committed Oct 6, 2023
1 parent 5e3677f commit 6d330eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion botorch/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _get_group_subset_indices(
idcs = [idx % cum_output_sizes[-1] for idx in idcs]
group_indices: Dict[int, List[int]] = defaultdict(list)
for idx in idcs:
grp_idx = int(np.argwhere(idx < cum_output_sizes)[0])
grp_idx = np.argwhere(idx < cum_output_sizes)[0].item()
sub_idx = idx - int(np.sum(output_sizes[:grp_idx]))
group_indices[grp_idx].append(sub_idx)
return group_indices
Expand Down

0 comments on commit 6d330eb

Please sign in to comment.