!63307 [mindflow]: fix ci error

Merge pull request !63307 from Brian-K/fix1219
This commit is contained in:
i-robot 2023-12-19 06:20:30 +00:00 committed by Gitee
commit 4287329378
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 13 deletions

View File

@ -29,14 +29,14 @@ np.random.seed(123456)
class Net(nn.Cell):
def __init__(self, in_channels=2, hidden_channels=128, out_channels=1, act=nn.Tanh()):
def __init__(self, in_channels=2, hidden_channels=128, out_channels=1):
super().__init__()
self.act = act
act = nn.Tanh()
self.layers = nn.SequentialCell(
nn.Dense(in_channels, hidden_channels, activation=self.act),
nn.Dense(hidden_channels, hidden_channels, activation=self.act),
nn.Dense(hidden_channels, hidden_channels, activation=self.act),
nn.Dense(hidden_channels, hidden_channels, activation=self.act),
nn.Dense(in_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, out_channels)
)
@ -44,7 +44,7 @@ class Net(nn.Cell):
return self.layers(x)
@pytest.mark.level1
@pytest.mark.level0
@pytest.mark.platform_arm_ascend_training
@pytest.mark.platform_x86_ascend_training
@pytest.mark.platform_x86_gpu_training

View File

@ -30,13 +30,13 @@ np.random.seed(123456)
class Net(nn.Cell):
"""MLP"""
def __init__(self, in_channels=2, hidden_channels=128, out_channels=1, act=nn.Tanh()):
def __init__(self, in_channels=2, hidden_channels=128, out_channels=1):
super().__init__()
self.act = act
act = nn.Tanh()
self.layers = nn.SequentialCell(
nn.Dense(in_channels, hidden_channels, activation=self.act),
nn.Dense(hidden_channels, hidden_channels, activation=self.act),
nn.Dense(hidden_channels, hidden_channels, activation=self.act),
nn.Dense(in_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, hidden_channels, activation=act),
nn.Dense(hidden_channels, out_channels)
)
@ -44,7 +44,7 @@ class Net(nn.Cell):
return self.layers(x)
@pytest.mark.level1
@pytest.mark.level0
@pytest.mark.platform_arm_ascend_training
@pytest.mark.platform_x86_ascend_training
@pytest.mark.platform_x86_gpu_training