Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
longranger2 committed Nov 8, 2023
1 parent f1fb0ee commit 773d8c2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/legacy_test/test_empty_like_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from paddle.base import core
from paddle.base.data_feeder import convert_dtype
from paddle.pir_utils import test_with_pir_api
from paddle.static import Program, program_guard


class TestEmptyLikeAPICommon(unittest.TestCase):
Expand Down Expand Up @@ -167,10 +166,10 @@ def setUp(self):
@test_with_pir_api
def test_static_graph(self):
paddle.enable_static()
train_program = Program()
startup_program = Program()
train_program = paddle.static.Program()
startup_program = paddle.static.Program()

with program_guard(train_program, startup_program):
with paddle.static.program_guard(train_program, startup_program):
x = np.random.random(self.x_shape).astype(self.dtype)
data_x = paddle.static.data(
'x', shape=self.data_x_shape, dtype=self.dtype
Expand All @@ -185,11 +184,11 @@ def test_static_graph(self):
)
exe = paddle.static.Executor(place)
res = exe.run(train_program, feed={'x': x}, fetch_list=[out])

self.dst_dtype = self.dtype
self.dst_shape = x.shape
self.__check_out__(res[0])

paddle.disable_static()

def init_config(self):
Expand Down

0 comments on commit 773d8c2

Please sign in to comment.