From 11b57760c8c1e92d538cc4418a61e71d08bb81d5 Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Thu, 10 Jun 2021 11:52:58 +0800 Subject: [PATCH] [Dy2stat] Change Some Fluid API to 2.0 API (#33460) As the title --- .../tests/unittests/dygraph_to_static/test_tensor_shape.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tensor_shape.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tensor_shape.py index 70749c2e244..ace49db1073 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tensor_shape.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_tensor_shape.py @@ -29,10 +29,10 @@ def dyfunc_tensor_shape_1(x): def dyfunc_tensor_shape_2(x): - x = fluid.dygraph.to_variable(x) + x = paddle.to_tensor(x) shape = x.shape shape2 = shape - res = fluid.layers.reshape(x, shape2) + res = paddle.reshape(x, shape2) return res @@ -190,7 +190,7 @@ def dyfunc_with_while_3(x): def dyfunc_with_while_4(x): - x = fluid.dygraph.to_variable(x) + x = paddle.to_tensor(x) y = numpy.ones(5) y_shape_0 = y.shape[0] i = 1 -- GitLab