Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dy2St][PIR] Enable PIR ut test_container #63182

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/dygraph_to_static/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import unittest

import numpy as np
from dygraph_to_static_utils import Dy2StTestBase
from dygraph_to_static_utils import (
Dy2StTestBase,
test_legacy_and_pt_and_pir,
)

import paddle
from paddle.framework import use_pir_api
Expand Down Expand Up @@ -73,7 +76,6 @@ def forward(self, x):

class TestSequential(Dy2StTestBase):
def setUp(self):
paddle.set_device('cpu')
self.seed = 2021
self.temp_dir = tempfile.TemporaryDirectory()
self._init_config()
Expand Down Expand Up @@ -110,8 +112,8 @@ def _run(self, to_static):

return out

@test_legacy_and_pt_and_pir
def test_train(self):
paddle.jit.set_code_level(100)
dy_out = self._run(to_static=False)
st_out = self._run(to_static=True)
np.testing.assert_allclose(
Expand Down