Skip to content

Commit

Permalink
fix dropout (#57767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-hit authored Sep 27, 2023
1 parent b66b899 commit c440159
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions test/legacy_test/test_dropout_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ def apply_to_static(net, use_cinn):
(
(
'fp32',
np.random.rand(100000),
np.ones(100000),
0.3,
False,
'upscale_in_train',
Expand All @@ -1528,7 +1528,7 @@ def apply_to_static(net, use_cinn):
),
(
'bfp16',
np.random.rand(100000),
np.ones(100000),
0.3,
False,
'upscale_in_train',
Expand All @@ -1538,7 +1538,7 @@ def apply_to_static(net, use_cinn):
),
(
'fp64',
np.random.rand(100000),
np.ones(100000),
0.7,
False,
'upscale_in_train',
Expand All @@ -1548,7 +1548,7 @@ def apply_to_static(net, use_cinn):
),
(
'is_test=True',
np.random.rand(100000),
np.ones(100000),
0.5,
True,
'upscale_in_train',
Expand All @@ -1558,7 +1558,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=1.0',
np.random.rand(100000),
np.ones(100000),
1.0,
True,
'upscale_in_train',
Expand All @@ -1568,7 +1568,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=1.0,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
1.0,
True,
'upscale_in_train',
Expand All @@ -1578,7 +1578,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=1.0,test=False',
np.random.rand(100000),
np.ones(100000),
1.0,
False,
'upscale_in_train',
Expand All @@ -1588,7 +1588,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=1.0,test=False,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
1.0,
False,
'upscale_in_train',
Expand All @@ -1598,7 +1598,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=0.0',
np.random.rand(100000),
np.ones(100000),
0,
True,
'upscale_in_train',
Expand All @@ -1608,7 +1608,7 @@ def apply_to_static(net, use_cinn):
),
(
'p=0.0,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
0,
True,
'upscale_in_train',
Expand All @@ -1618,7 +1618,7 @@ def apply_to_static(net, use_cinn):
),
(
'downgrade_train',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand All @@ -1628,7 +1628,7 @@ def apply_to_static(net, use_cinn):
),
(
'downgrade_train,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand All @@ -1638,7 +1638,7 @@ def apply_to_static(net, use_cinn):
),
(
'fp32_cpu',
np.random.rand(100000),
np.ones(100000),
0.6,
False,
'upscale_in_train',
Expand All @@ -1648,7 +1648,7 @@ def apply_to_static(net, use_cinn):
),
(
'fp64_cpu',
np.random.rand(100000),
np.ones(100000),
0.6,
False,
'upscale_in_train',
Expand All @@ -1658,7 +1658,7 @@ def apply_to_static(net, use_cinn):
),
(
'downgrade_train_cpu',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand Down Expand Up @@ -1860,7 +1860,7 @@ def test_jit_comp_with_cinn(self):
(
(
'fp32',
np.random.rand(100000),
np.ones(100000),
0.3,
False,
'upscale_in_train',
Expand All @@ -1870,7 +1870,7 @@ def test_jit_comp_with_cinn(self):
),
(
'bfp16',
np.random.rand(100000),
np.ones(100000),
0.3,
False,
'upscale_in_train',
Expand All @@ -1880,7 +1880,7 @@ def test_jit_comp_with_cinn(self):
),
(
'fp64',
np.random.rand(100000),
np.ones(100000),
0.7,
False,
'upscale_in_train',
Expand All @@ -1890,7 +1890,7 @@ def test_jit_comp_with_cinn(self):
),
(
'is_test=True',
np.random.rand(100000),
np.ones(100000),
0.5,
True,
'upscale_in_train',
Expand All @@ -1900,7 +1900,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=1.0',
np.random.rand(100000),
np.ones(100000),
1.0,
True,
'upscale_in_train',
Expand All @@ -1910,7 +1910,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=1.0,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
1.0,
True,
'upscale_in_train',
Expand All @@ -1920,7 +1920,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=1.0,test=False',
np.random.rand(100000),
np.ones(100000),
1.0,
False,
'upscale_in_train',
Expand All @@ -1930,7 +1930,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=1.0,test=False,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
1.0,
False,
'upscale_in_train',
Expand All @@ -1940,7 +1940,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=0.0',
np.random.rand(100000),
np.ones(100000),
0,
True,
'upscale_in_train',
Expand All @@ -1950,7 +1950,7 @@ def test_jit_comp_with_cinn(self):
),
(
'p=0.0,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
0,
True,
'upscale_in_train',
Expand All @@ -1960,7 +1960,7 @@ def test_jit_comp_with_cinn(self):
),
(
'downgrade_train',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand All @@ -1970,7 +1970,7 @@ def test_jit_comp_with_cinn(self):
),
(
'downgrade_train,dtype=bfp16',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand All @@ -1980,7 +1980,7 @@ def test_jit_comp_with_cinn(self):
),
(
'fp32_cpu',
np.random.rand(100000),
np.ones(100000),
0.6,
False,
'upscale_in_train',
Expand All @@ -1990,7 +1990,7 @@ def test_jit_comp_with_cinn(self):
),
(
'fp64_cpu',
np.random.rand(100000),
np.ones(100000),
0.6,
False,
'upscale_in_train',
Expand All @@ -2000,7 +2000,7 @@ def test_jit_comp_with_cinn(self):
),
(
'downgrade_train_cpu',
np.random.rand(100000),
np.ones(100000),
0.5,
False,
'downscale_in_infer',
Expand Down

0 comments on commit c440159

Please sign in to comment.