Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def save(self, filepath, overwrite=True, save_format=None, **kwargs):
     save.save_torch_model(self,
                           filepath,
                           overwrite=overwrite,
                           save_format=save_format,
                           **kwargs)