Skip to content

Commit 17eef3a

Browse files
author
Peng Li
committed
add a warning to docstring of Parameters.to_tar()
1 parent 4da6e86 commit 17eef3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

python/paddle/v2/parameters.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,17 @@ def deserialize(self, name, f):
322322
self.set(name, arr.reshape(self.get_shape(name)))
323323

324324
def to_tar(self, f):
325+
"""
326+
Save parameters to a tar file.
327+
328+
WARNING: Do not use this function to save parameters directly unless you
329+
know exactly what you are doing. `paddle.v2.trainer.SGD.save_parameter_to_tar(f)`
330+
should be used instead.
331+
332+
:param f:
333+
:type f: file
334+
:return:
335+
"""
325336
tar = tarfile.TarFile(fileobj=f, mode='w')
326337
for nm in self.names():
327338
buf = cStringIO.StringIO()

0 commit comments

Comments
 (0)