diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index 7b62ae9102d222d5862215b140d5b90919adf871..a69bc64c4cf66906e8c3168b3ac063d69edaf370 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -952,7 +952,6 @@ def empty(shape, dtype=None, name=None): import paddle import numpy as np - paddle.disable_static() # Now we are in imperative mode paddle.set_device("cpu") # and use cpu device # example 1: argument ``shape`` is a list which doesn't contain Tensor. @@ -1036,7 +1035,6 @@ def empty_like(x, dtype=None, name=None): import paddle import numpy as np - paddle.disable_static() # Now we are in imperative mode paddle.set_device("cpu") # and use cpu device x = paddle.randn([2, 3], 'float32') diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 2745464995f5d2247613b256dfc3461f19432024..e46a26bf45ba6d3f1be20efe12d19a0f43511ab1 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -921,13 +921,11 @@ def mv(x, vec, name=None): import numpy as np import paddle - paddle.disable_static() x_data = np.array([[2, 1, 3], [3, 0, 1]]).astype("float64") x = paddle.to_tensor(x_data) vec_data = np.array([3, 5, 1]) vec = paddle.to_tensor(vec_data).astype("float64") out = paddle.mv(x, vec) - paddle.enable_static() """ if in_dygraph_mode(): out = core.ops.mv(x, vec)