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 70749c2e24447e67f267dcfe396dec18d2dcebab..ace49db1073e26ce6d930adbf405367d959e1601 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