From 9c9d1b06757741ad7ddfdf1e3154dd4d78b6c435 Mon Sep 17 00:00:00 2001 From: jiweibo Date: Sun, 27 Sep 2020 08:32:27 +0000 Subject: [PATCH] update. --- doc/paddle/api/paddle/fluid/layers/nn/py_func_cn.rst | 4 ++-- doc/paddle/api/paddle/fluid/param_attr/ParamAttr_cn.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/paddle/api/paddle/fluid/layers/nn/py_func_cn.rst b/doc/paddle/api/paddle/fluid/layers/nn/py_func_cn.rst index b2c06f8c3..3c5f6fe3e 100644 --- a/doc/paddle/api/paddle/fluid/layers/nn/py_func_cn.rst +++ b/doc/paddle/api/paddle/fluid/layers/nn/py_func_cn.rst @@ -107,8 +107,8 @@ PaddlePaddle 通过py_func在Python端注册OP。py_func的设计原理在于Pad main_program = paddle.static.default_main_program() # 创建前向函数的输入变量 - x = paddle.data(name='x', shape=[2,3], dtype='int32') - y = paddle.data(name='y', shape=[2,3], dtype='int32') + x = paddle.static.data(name='x', shape=[2,3], dtype='int32') + y = paddle.static.data(name='y', shape=[2,3], dtype='int32') # 创建前向函数的输出变量,必须指明变量名称name/数据类型dtype/维度shape output = create_tmp_var('output','int32', [3,1]) diff --git a/doc/paddle/api/paddle/fluid/param_attr/ParamAttr_cn.rst b/doc/paddle/api/paddle/fluid/param_attr/ParamAttr_cn.rst index 212901778..b3947784a 100644 --- a/doc/paddle/api/paddle/fluid/param_attr/ParamAttr_cn.rst +++ b/doc/paddle/api/paddle/fluid/param_attr/ParamAttr_cn.rst @@ -42,7 +42,7 @@ ParamAttr trainable=True) print(w_param_attrs.name) # "fc_weight" paddle.enable_static() - x = paddle.data(name='X', shape=[1], dtype='float32') + x = paddle.static.data(name='X', shape=[1], dtype='float32') y_predict = paddle.static.nn.fc(input=x, size=10, param_attr=w_param_attrs) -- GitLab