提交 17eef3a3 编写于 作者: P Peng Li

add a warning to docstring of Parameters.to_tar()

上级 4da6e86f
......@@ -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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册