Skip to content

Commit

Permalink
[PIR] Adaptation of TestSundryAPIStatic.test_static_data (#62879)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil authored Mar 20, 2024
1 parent 790f016 commit d977652
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/legacy_test/test_zero_dim_sundry_static_api_part3.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def test_sequence_pad(self):
res = self.exe.run(prog, feed={"x": x_tensor}, fetch_list=[out])
self.assertEqual(res[0].shape, (3, 4, 2))

@test_with_pir_api
@prog_scope()
def test_static_data(self):
x1 = paddle.static.data(name="x1", shape=[])
Expand All @@ -372,9 +373,7 @@ def test_static_data(self):
feed={
"x1": np.array(1.0, dtype='float32'),
},
fetch_list=[
x1.name,
],
fetch_list=[x1],
)
self.assertEqual(res[0].shape, ())
self.assertEqual(res[0], np.array(1.0))
Expand All @@ -389,9 +388,7 @@ def test_static_data(self):
"x2": 100.5,
"x3": 200.5,
},
fetch_list=[
y.name,
],
fetch_list=[y],
)
self.assertEqual(res[0].shape, ())
self.assertEqual(res[0], 301.0)
Expand Down

0 comments on commit d977652

Please sign in to comment.