提交 e784884e 编写于 作者: X xjqbest

add Example in doc string of split_filelist

test=develop
上级 1c0ef929
......@@ -247,6 +247,12 @@ class Fleet(object):
for example, filelist is [a, b, c ,d, e] and trainer_num = 2,
then trainer 0 gets [a, b, c] and trainer 1 gets [d, e]
Example:
>>> all_filelist = ["a.txt", "b.txt", "c.txt"]
>>> my_filelist = fleet.split_filelist(all_filelist)
>>> dataset = fluid.DatasetFactory().create_dataset()
>>> dataset.set_filelist(my_filelist)
Args:
filelist(list): list of filename, can be local or hdfs/afs.
......@@ -266,8 +272,8 @@ class Fleet(object):
length = file_num / trainer_num + (i < (file_num % trainer_num))
start = end
end += length
myfilelist = filelist[start:end]
return myfilelist
my_filelist = filelist[start:end]
return my_filelist
def _set_opt_info(self, opt_info):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册