diff --git a/test/legacy_test/test_dropout_op.py b/test/legacy_test/test_dropout_op.py index 609e7374f6b09..e18f24e2c3915 100644 --- a/test/legacy_test/test_dropout_op.py +++ b/test/legacy_test/test_dropout_op.py @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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', @@ -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',