1b12a45ddd604bdcbb01ef7016e6da491e8d3c10,optuna/storages/cached_storage.py,_CachedStorage,get_all_trials,#_CachedStorage#Any#Any#,287
Before Change
trials = self._backend.get_all_trials(study_id, deepcopy=False)
if study_id in self._studies:
for key, trial in self._studies[study_id].trials.items():
trials[trial.number] = trial
return copy.deepcopy(trials) if deepcopy else trials
def get_n_trials(self, study_id: int, state: Optional[TrialState] = None) -> int:
After Change
self._studies[study_id] = _StudyInfo()
study = self._studies[study_id]
trials = self._backend._get_uncached_trials(study_id, study.cached_trial_ids)
if trials:
self._add_trials_to_cache(study_id, trials)
for trial in trials:
if trial.state.is_finished():
study.cached_trial_ids.add(trial._trial_id)
return copy.deepcopy(study.trials) if deepcopy else study.trials[:]
def get_n_trials(self, study_id: int, state: Optional[TrialState] = None) -> int:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: pfnet/optuna
Commit Name: 1b12a45ddd604bdcbb01ef7016e6da491e8d3c10
Time: 2020-05-21
Author: ytsmiling@gmail.com
File Name: optuna/storages/cached_storage.py
Class Name: _CachedStorage
Method Name: get_all_trials
Project Name: pfnet/optuna
Commit Name: 1b12a45ddd604bdcbb01ef7016e6da491e8d3c10
Time: 2020-05-21
Author: ytsmiling@gmail.com
File Name: optuna/storages/cached_storage.py
Class Name: _CachedStorage
Method Name: create_new_trial
Project Name: pfnet/optuna
Commit Name: 1b12a45ddd604bdcbb01ef7016e6da491e8d3c10
Time: 2020-05-21
Author: ytsmiling@gmail.com
File Name: optuna/storages/cached_storage.py
Class Name: _CachedStorage
Method Name: set_trial_state