diff --git a/doc/fluid/api_cn/fluid_cn/gradients_cn.rst b/doc/fluid/api_cn/fluid_cn/gradients_cn.rst index 7e2e7d4fd635de3332aea4f293951567dd66c79c..b38f2747aafb9d258a49eaca315afa03cc747d56 100644 --- a/doc/fluid/api_cn/fluid_cn/gradients_cn.rst +++ b/doc/fluid/api_cn/fluid_cn/gradients_cn.rst @@ -26,7 +26,7 @@ gradients import paddle.fluid as fluid - x = fluid.layers.data(name='x', shape=[2,8,8], dtype='float32') + x = fluid.data(name='x', shape=[None,2,8,8], dtype='float32') x.stop_gradient=False y = fluid.layers.conv2d(x, 4, 1, bias_attr=False) y = fluid.layers.relu(y) diff --git a/doc/fluid/api_cn/fluid_cn/program_guard_cn.rst b/doc/fluid/api_cn/fluid_cn/program_guard_cn.rst index 83c53aeab3e1791ca5f99fa1db623a24e465acdd..a7f6f9dba999214aa956bf2c3e6847837179e6e2 100644 --- a/doc/fluid/api_cn/fluid_cn/program_guard_cn.rst +++ b/doc/fluid/api_cn/fluid_cn/program_guard_cn.rst @@ -23,7 +23,7 @@ program_guard main_program = fluid.Program() startup_program = fluid.Program() with fluid.program_guard(main_program, startup_program): - data = fluid.layers.data(name='image', shape=[784, 784], dtype='float32') + data = fluid.data(name='image', shape=[None, 784, 784], dtype='float32') hidden = fluid.layers.fc(input=data, size=10, act='relu') 例如,当组的网不需要startup_program初始化各变量时,可以传入一个临时的program。 @@ -36,5 +36,5 @@ program_guard main_program = fluid.Program() # 如果您不需要关心startup program,传入一个临时值即可 with fluid.program_guard(main_program, fluid.Program()): - data = fluid.layers.data(name='image', shape=[784, 784], dtype='float32') + data = fluid.data(name='image', shape=[None, 784, 784], dtype='float32')