提交 9c9d1b06 编写于 作者: J jiweibo

update.

上级 a0e2684a
...@@ -107,8 +107,8 @@ PaddlePaddle 通过py_func在Python端注册OP。py_func的设计原理在于Pad ...@@ -107,8 +107,8 @@ PaddlePaddle 通过py_func在Python端注册OP。py_func的设计原理在于Pad
main_program = paddle.static.default_main_program() main_program = paddle.static.default_main_program()
# 创建前向函数的输入变量 # 创建前向函数的输入变量
x = paddle.data(name='x', shape=[2,3], dtype='int32') x = paddle.static.data(name='x', shape=[2,3], dtype='int32')
y = paddle.data(name='y', shape=[2,3], dtype='int32') y = paddle.static.data(name='y', shape=[2,3], dtype='int32')
# 创建前向函数的输出变量,必须指明变量名称name/数据类型dtype/维度shape # 创建前向函数的输出变量,必须指明变量名称name/数据类型dtype/维度shape
output = create_tmp_var('output','int32', [3,1]) output = create_tmp_var('output','int32', [3,1])
......
...@@ -42,7 +42,7 @@ ParamAttr ...@@ -42,7 +42,7 @@ ParamAttr
trainable=True) trainable=True)
print(w_param_attrs.name) # "fc_weight" print(w_param_attrs.name) # "fc_weight"
paddle.enable_static() 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) y_predict = paddle.static.nn.fc(input=x, size=10, param_attr=w_param_attrs)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册