Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TransitionChoice with repetitions #696

Merged
merged 12 commits into from
May 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
jrapin committed May 26, 2020
commit c5bab6822f4c288071d3b6104954de660271f072
6 changes: 1 addition & 5 deletions nevergrad/parametrization/choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,7 @@ def _find_and_set_value(self, values: tp.Any) -> np.ndarray:
self._set_index(indices)
return indices

def _set_index(self, index: int) -> None:
if isinstance(index, int):
indices = np.array([index])
else:
indices = index
def _set_index(self, indices: np.ndarray) -> None:
self.position.value = indices + 0.5

@property
Expand Down