def load(self, load_path, name, global_step, *args, **kwargs): res = files.load_json(file_path=os.path.join(load_path, "{}-{}.json".format(name, global_step))) # todo this mapping can be done via a dict structure if '_parameters' in res: setattr(self, '_parameters', res['_parameters']) if '_source_config' in res: setattr(self._source_config, 'config_dict', res['_source_config'])
def load_json(file_path): return files.load_json(file_path)