Skip to content

Commit

Permalink
【PIR API adaptor No.50、57、67】fix for 58466 (PaddlePaddle#58541)
Browse files Browse the repository at this point in the history
  • Loading branch information
longranger2 committed Nov 3, 2023
1 parent d8e3a15 commit a13ba32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/legacy_test/test_cumprod_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import paddle
from paddle.base import core
from paddle.pir_utils import test_with_pir_api

np.random.seed(0)

Expand Down Expand Up @@ -218,6 +219,7 @@ def setUp(self):
self.place.append(paddle.CUDAPlace(0))

# test static graph api.
@test_with_pir_api
def test_static_api(self):
paddle.enable_static()

Expand Down
4 changes: 3 additions & 1 deletion test/legacy_test/test_digamma_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import paddle
from paddle import base, static
from paddle.base import core
from paddle.pir_utils import test_with_pir_api


class TestDigammaOp(OpTest):
Expand Down Expand Up @@ -106,6 +107,7 @@ def setUp(self):
self.places.append(paddle.CUDAPlace(0))
self._shape = [8, 3, 32, 32]

@test_with_pir_api
def test_in_static_mode(self):
def init_input_output(dtype):
input = np.random.random(self._shape).astype(dtype)
Expand All @@ -119,7 +121,7 @@ def init_input_output(dtype):
out = paddle.digamma(x)

exe = static.Executor(place)
out_value = exe.run(feed=input_dict, fetch_list=[out.name])
out_value = exe.run(feed=input_dict, fetch_list=[out])
np.testing.assert_allclose(out_value[0], sc_res, rtol=1e-05)

def test_in_dynamic_mode(self):
Expand Down

0 comments on commit a13ba32

Please sign in to comment.