From 936676abbf536488e96ae7ef619888d47108c563 Mon Sep 17 00:00:00 2001 From: kangguangli Date: Thu, 8 Dec 2022 16:42:02 +0800 Subject: [PATCH] [remove fluid.layers.matmul] remove fluid.layers.matmul in example code (#48818) * replace fluid.layers.matmul in fluid/io.py * fix doc error in fluid.layers.nn.sampling_id --- python/paddle/fluid/io.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 10a91a15f84..5e301d834b3 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -358,7 +358,7 @@ def save_vars( data = fluid.layers.data(name="img", shape=[64, 784], append_batch_size=False) w = paddle.create_parameter(shape=[784, 200], dtype='float32', name='fc_w') b = paddle.create_parameter(shape=[200], dtype='float32', name='fc_b') - hidden_w = fluid.layers.matmul(x=data, y=w) + hidden_w = paddle.matmul(x=data, y=w) hidden_b = fluid.layers.elementwise_add(hidden_w, b) place = fluid.CPUPlace() exe = fluid.Executor(place) @@ -827,7 +827,7 @@ def load_vars( data = fluid.layers.data(name="img", shape=[64, 784], append_batch_size=False) w = paddle.create_parameter(shape=[784, 200], dtype='float32', name='fc_w') b = paddle.create_parameter(shape=[200], dtype='float32', name='fc_b') - hidden_w = fluid.layers.matmul(x=data, y=w) + hidden_w = paddle.matmul(x=data, y=w) hidden_b = fluid.layers.elementwise_add(hidden_w, b) place = fluid.CPUPlace() exe = fluid.Executor(place) @@ -1592,7 +1592,7 @@ def load_inference_model( data = fluid.layers.data(name="img", shape=[64, 784], append_batch_size=False) w = paddle.create_parameter(shape=[784, 200], dtype='float32') b = paddle.create_parameter(shape=[200], dtype='float32') - hidden_w = fluid.layers.matmul(x=data, y=w) + hidden_w = paddle.matmul(x=data, y=w) hidden_b = fluid.layers.elementwise_add(hidden_w, b) place = fluid.CPUPlace() exe = fluid.Executor(place) -- GitLab