Merge pull request #5033 from pengli09/add-a-warning

Add a warning to the docstring of Parameters.to_tar()
revert-4814-Add_sequence_project_op
Peng LI 7 years ago committed by GitHub
commit 25588a3831

@ -326,6 +326,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: You should use `paddle.v2.trainer.SGD.save_parameter_to_tar(f)`
to save parameters most of the time. Otherwise, some settings such
as model average will not take effect.
:param f:
:type f: file
:return:
"""
tar = tarfile.TarFile(fileobj=f, mode='w')
for nm in self.names():
buf = cStringIO.StringIO()

Loading…
Cancel
Save