Skip to content

Commit

Permalink
[Dy2St] Fix test_pylayer random failed (#58515)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo authored Oct 31, 2023
1 parent f0ea1d6 commit 75afa68
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/dygraph_to_static/test_pylayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import unittest

import numpy as np
from dygraph_to_static_utils_new import Dy2StTestBase
from test_jit_save_load import train

import paddle
Expand Down Expand Up @@ -263,7 +262,7 @@ def forward(self, x):
return out


class TestPyLayerBase(Dy2StTestBase):
class TestPyLayerBase(unittest.TestCase):
def setUp(self):
self.place = "gpu" if paddle.is_compiled_with_cuda() else "cpu"
self.to_static = False
Expand Down Expand Up @@ -513,7 +512,7 @@ def test_pylayer_net_with_no_grad(self):
self._run_and_compare(input1, input2)


class PyLayerTrainHelper(Dy2StTestBase):
class PyLayerTrainHelper(unittest.TestCase):
def setUp(self):
self.place = "gpu" if paddle.is_compiled_with_cuda() else "cpu"

Expand Down Expand Up @@ -586,7 +585,7 @@ def test_pylayer_net_no_grad(self):
)


class TestPyLayerJitSaveLoad(Dy2StTestBase):
class TestPyLayerJitSaveLoad(unittest.TestCase):
def setUp(self):
self.temp_dir = tempfile.TemporaryDirectory()
self.model_path = os.path.join(
Expand Down

0 comments on commit 75afa68

Please sign in to comment.