def save(self, path=None, as_model=False, overwrite=True, save_format=None, **kwargs): if not path: path = self.weight_path makedirs_from_path(path) if as_model: if self.kind == "T": save.save_tf_model(self.model, path, overwrite=overwrite, save_format=save_format, **kwargs) else: save.save_torch_model(self.model, path, overwrite=overwrite, save_format=save_format, **kwargs) else: if self.kind == "T": save.save_tf_weights(self.model, path, overwrite=overwrite, save_format=save_format) else: save.save_torch_weights(self.model, path, overwrite=overwrite, save_format=save_format)
def save_weights(self, filepath, overwrite=True, save_format=None): save.save_torch_weights(self, filepath, overwrite=overwrite, save_format=save_format)