From 76d8fa025280ef121315c244c62db3282d2f18c2 Mon Sep 17 00:00:00 2001 From: hutuxian Date: Fri, 15 May 2020 23:54:41 +0800 Subject: [PATCH] update api (#2118) (#2120) --- .../distributed_training/fleet_api_howto_cn.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/fluid/advanced_guide/distributed_training/fleet_api_howto_cn.rst b/doc/fluid/advanced_guide/distributed_training/fleet_api_howto_cn.rst index 15d5508a9..21f3ea861 100644 --- a/doc/fluid/advanced_guide/distributed_training/fleet_api_howto_cn.rst +++ b/doc/fluid/advanced_guide/distributed_training/fleet_api_howto_cn.rst @@ -51,8 +51,8 @@ API最常见的两种使用场景,用一个模型做示例,目的是让用 from nets import mlp from utils import gen_data - input_x = fluid.layers.data(name="x", shape=[32], dtype='float32') - input_y = fluid.layers.data(name="y", shape=[1], dtype='int64') + input_x = fluid.data(name="x", shape=[None, 32], dtype='float32') + input_y = fluid.data(name="y", shape=[None, 1], dtype='int64') cost = mlp(input_x, input_y) optimizer = fluid.optimizer.SGD(learning_rate=0.01) @@ -79,8 +79,8 @@ API最常见的两种使用场景,用一个模型做示例,目的是让用 from paddle.fluid.incubate.fleet.base import role_maker from utils import gen_data - input_x = fluid.layers.data(name="x", shape=[32], dtype='float32') - input_y = fluid.layers.data(name="y", shape=[1], dtype='int64') + input_x = fluid.data(name="x", shape=[None, 32], dtype='float32') + input_y = fluid.data(name="y", shape=[None, 1], dtype='int64') cost = mlp(input_x, input_y) optimizer = fluid.optimizer.SGD(learning_rate=0.01) @@ -119,8 +119,8 @@ API最常见的两种使用场景,用一个模型做示例,目的是让用 from paddle.fluid.incubate.fleet.base import role_maker from utils import gen_data - input_x = fluid.layers.data(name="x", shape=[32], dtype='float32') - input_y = fluid.layers.data(name="y", shape=[1], dtype='int64') + input_x = fluid.data(name="x", shape=[None, 32], dtype='float32') + input_y = fluid.data(name="y", shape=[None, 1], dtype='int64') cost = mlp(input_x, input_y) optimizer = fluid.optimizer.SGD(learning_rate=0.01) -- GitLab