Skip to content

Commit 6d330eb

Browse files
dme65facebook-github-bot
authored andcommitted
Numpy deprecation warning (#2037)
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
1 parent 5e3677f commit 6d330eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

botorch/models/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def _get_group_subset_indices(
427427
idcs = [idx % cum_output_sizes[-1] for idx in idcs]
428428
group_indices: Dict[int, List[int]] = defaultdict(list)
429429
for idx in idcs:
430-
grp_idx = int(np.argwhere(idx < cum_output_sizes)[0])
430+
grp_idx = np.argwhere(idx < cum_output_sizes)[0].item()
431431
sub_idx = idx - int(np.sum(output_sizes[:grp_idx]))
432432
group_indices[grp_idx].append(sub_idx)
433433
return group_indices

0 commit comments

Comments
 (0)