Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
e08515ce
Unverified
Commit
e08515ce
authored
Nov 05, 2021
by
Erik Fäßler
Committed by
GitHub
Nov 05, 2021
Browse files
Fix bug where numpy array is used as a truth value (#4286)
parent
e875f1db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
nni/algorithms/hpo/bohb_advisor/config_generator.py
nni/algorithms/hpo/bohb_advisor/config_generator.py
+1
-1
No files found.
nni/algorithms/hpo/bohb_advisor/config_generator.py
View file @
e08515ce
...
...
@@ -243,7 +243,7 @@ class CG_BOHB:
while
np
.
any
(
nan_indices
):
nan_idx
=
nan_indices
[
0
]
valid_indices
=
np
.
argwhere
(
np
.
isfinite
(
array
[:,
nan_idx
])).
flatten
()
if
valid_indices
:
if
len
(
valid_indices
)
>
0
:
# pick one of them at random and overwrite all NaN values
row_idx
=
np
.
random
.
choice
(
valid_indices
)
datum
[
nan_indices
]
=
array
[
row_idx
,
nan_indices
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment