Skip to content

Commit

Permalink
Merge pull request #4774 from not522/shallow-copy-trial
Browse files Browse the repository at this point in the history
Use shallow copy in `_get_latest_trial`
  • Loading branch information
toshihikoyanase committed Jul 12, 2023
2 parents 4513785 + 84d71ba commit 8409371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optuna/trial/_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def _check_distribution(self, name: str, distribution: BaseDistribution) -> None

def _get_latest_trial(self) -> FrozenTrial:
# TODO(eukaryo): Remove this method after `system_attrs` property is removed.
latest_trial = copy.deepcopy(self._cached_frozen_trial)
latest_trial = copy.copy(self._cached_frozen_trial)
latest_trial.system_attrs = _LazyTrialSystemAttrs( # type: ignore[assignment]
self._trial_id, self.storage
)
Expand Down

0 comments on commit 8409371

Please sign in to comment.