def to_flyte_idl(self) -> _pb2_hpo_job.HyperparameterTuningJobConfig: return _pb2_hpo_job.HyperparameterTuningJobConfig( tuning_strategy=self._tuning_strategy, tuning_objective=self._tuning_objective.to_flyte_idl(), training_job_early_stopping_type=self._training_job_early_stopping_type, )
def to_python_value( self, ctx: FlyteContext, lv: Literal, expected_python_type: Type[_hpo_job_model.HyperparameterTuningJobConfig] ) -> _hpo_job_model.HyperparameterTuningJobConfig: if lv and lv.scalar and lv.scalar.generic is not None: d = json.loads(json_format.MessageToJson(lv.scalar.generic)) o = _pb2_hpo_job.HyperparameterTuningJobConfig() o = json_format.ParseDict(d, o) return _hpo_job_model.HyperparameterTuningJobConfig.from_flyte_idl(o) return None