From 17eef3a3f413a9b4c57a5c09c543ab9fa831bb29 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Tue, 24 Oct 2017 10:30:54 +0800 Subject: [PATCH] add a warning to docstring of Parameters.to_tar() --- python/paddle/v2/parameters.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/paddle/v2/parameters.py b/python/paddle/v2/parameters.py index 4cfd91882e2..300c35a41da 100644 --- a/python/paddle/v2/parameters.py +++ b/python/paddle/v2/parameters.py @@ -322,6 +322,17 @@ class Parameters(object): self.set(name, arr.reshape(self.get_shape(name))) def to_tar(self, f): + """ + Save parameters to a tar file. + + WARNING: Do not use this function to save parameters directly unless you + know exactly what you are doing. `paddle.v2.trainer.SGD.save_parameter_to_tar(f)` + should be used instead. + + :param f: + :type f: file + :return: + """ tar = tarfile.TarFile(fileobj=f, mode='w') for nm in self.names(): buf = cStringIO.StringIO() -- GitLab