(
self,
program: Program | None = None,
scope: core._Scope | None = None,
debug: bool = False,
fetch_list: list[Tensor] | None = None,
fetch_info: list[str] | None = None,
print_period: int = 100,
fetch_handler: FetchHandler | None = None,
)
| 2965 | ) |
| 2966 | |
| 2967 | def start_heter_trainer( |
| 2968 | self, |
| 2969 | program: Program | None = None, |
| 2970 | scope: core._Scope | None = None, |
| 2971 | debug: bool = False, |
| 2972 | fetch_list: list[Tensor] | None = None, |
| 2973 | fetch_info: list[str] | None = None, |
| 2974 | print_period: int = 100, |
| 2975 | fetch_handler: FetchHandler | None = None, |
| 2976 | ) -> core.TrainerBase: |
| 2977 | scope, trainer = self._prepare_trainer( |
| 2978 | program=program, |
| 2979 | dataset=None, |
| 2980 | scope=scope, |
| 2981 | thread=1, |
| 2982 | debug=debug, |
| 2983 | fetch_list=fetch_list, |
| 2984 | fetch_info=fetch_info, |
| 2985 | print_period=print_period, |
| 2986 | ) |
| 2987 | |
| 2988 | trainer._set_infer(False) |
| 2989 | trainer._gen_trainer_desc() |
| 2990 | |
| 2991 | self._dump_debug_info(program=program, trainer=trainer) |
| 2992 | |
| 2993 | trainer_instance = self._default_executor.init_for_dataset( |
| 2994 | program.desc, trainer._desc(), scope, None |
| 2995 | ) |
| 2996 | |
| 2997 | # if fetch_handler is not None: |
| 2998 | # scope0 = trainer_instance.get_worker_scope(0) |
| 2999 | # fetch_monitor = FetchHandlerMonitor(scope0, fetch_handler) |
| 3000 | # fetch_monitor.start() |
| 3001 | # self._default_executor.run_from_dataset(trainer_instance) |
| 3002 | # fetch_monitor.stop() |
| 3003 | # self._default_executor.release_trainer(trainer_instance) |
| 3004 | # else: |
| 3005 | |
| 3006 | self._default_executor.run_from_dataset(trainer_instance) |
| 3007 | # self._default_executor.release_trainer(trainer_instance) |
| 3008 | |
| 3009 | return trainer_instance |
| 3010 | |
| 3011 | def train_from_dataset( |
| 3012 | self, |
nothing calls this directly
no test coverage detected