未验证 提交 e5514935 编写于 作者: H Huihuang Zheng 提交者: GitHub

Modify Executor Example Code to Use fluid.data, test=document_fix (#25893)

As the title
上级 78afbb12
...@@ -1460,8 +1460,8 @@ class Executor(object): ...@@ -1460,8 +1460,8 @@ class Executor(object):
place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu
exe = fluid.Executor(place) exe = fluid.Executor(place)
x = fluid.layers.data(name="x", shape=[10, 10], dtype="int64") x = fluid.data(name="x", shape=[None, 10, 10], dtype="int64")
y = fluid.layers.data(name="y", shape=[1], dtype="int64", lod_level=1) y = fluid.data(name="y", shape=[None, 1], dtype="int64", lod_level=1)
dataset = fluid.DatasetFactory().create_dataset() dataset = fluid.DatasetFactory().create_dataset()
dataset.set_use_var([x, y]) dataset.set_use_var([x, y])
dataset.set_thread(1) dataset.set_thread(1)
...@@ -1526,8 +1526,8 @@ class Executor(object): ...@@ -1526,8 +1526,8 @@ class Executor(object):
place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu place = fluid.CPUPlace() # you can set place = fluid.CUDAPlace(0) to use gpu
exe = fluid.Executor(place) exe = fluid.Executor(place)
x = fluid.layers.data(name="x", shape=[10, 10], dtype="int64") x = fluid.data(name="x", shape=[None, 10, 10], dtype="int64")
y = fluid.layers.data(name="y", shape=[1], dtype="int64", lod_level=1) y = fluid.data(name="y", shape=[None, 1], dtype="int64", lod_level=1)
dataset = fluid.DatasetFactory().create_dataset() dataset = fluid.DatasetFactory().create_dataset()
dataset.set_use_var([x, y]) dataset.set_use_var([x, y])
dataset.set_thread(1) dataset.set_thread(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册