add a warning to docstring of Parameters.to_tar()

revert-4814-Add_sequence_project_op
Peng Li 7 years ago
parent 4da6e86ff7
commit 17eef3a3f4

@ -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()

Loading…
Cancel
Save