From ad5a1b550cee7dec6fd98d0b05077fecc79a3120 Mon Sep 17 00:00:00 2001 From: hxf12345677 Date: Wed, 6 Apr 2022 16:11:42 +0800 Subject: [PATCH] =?UTF-8?q?ut=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_network_ops/test_batch_norm_stats.py | 1 + test/test_network_ops/test_batchnorm_backward_reduce.py | 2 ++ .../test_network_ops/test_batchnorm_gather_stats_with_counts.py | 1 + test/test_network_ops/test_npu_giou_backward.py | 1 + 4 files changed, 5 insertions(+) diff --git a/test/test_network_ops/test_batch_norm_stats.py b/test/test_network_ops/test_batch_norm_stats.py index 1af3ea4324d..665b6eac81d 100644 --- a/test/test_network_ops/test_batch_norm_stats.py +++ b/test/test_network_ops/test_batch_norm_stats.py @@ -37,6 +37,7 @@ class TestBatchNormStats(TestCase): return out_mean, out_invstd def test_batch_norm_stats(self, device="npu"): + np.random.seed(1234) shape_format = [ [[np.float16, -1, [2, 3, 12, 12]], 1e-5], ] diff --git a/test/test_network_ops/test_batchnorm_backward_reduce.py b/test/test_network_ops/test_batchnorm_backward_reduce.py index e252ff7bdf8..841daac02dd 100644 --- a/test/test_network_ops/test_batchnorm_backward_reduce.py +++ b/test/test_network_ops/test_batchnorm_backward_reduce.py @@ -36,6 +36,7 @@ class TestBatchNormBackwardReduce(TestCase): return list2 def test_batch_norm_backward_reduce_mix_precision(self, device="npu"): + np.random.seed(1234) shape_format = [ [[np.float16, -1, [1, 3, 9, 9]], [np.float32, -1, [3]], True, True, True], @@ -61,6 +62,7 @@ class TestBatchNormBackwardReduce(TestCase): self.assertRtolEqual(out16, out32) def test_batch_norm_backward_reduce(self, device="npu"): + np.random.seed(1234) shape_format = [ [[np.float32, -1, [1, 3, 9, 9]], [np.float32, -1, [3]], True, True, True], diff --git a/test/test_network_ops/test_batchnorm_gather_stats_with_counts.py b/test/test_network_ops/test_batchnorm_gather_stats_with_counts.py index 8bf7442958c..b7b3ad936d1 100644 --- a/test/test_network_ops/test_batchnorm_gather_stats_with_counts.py +++ b/test/test_network_ops/test_batchnorm_gather_stats_with_counts.py @@ -62,6 +62,7 @@ class TestBatchNormGatherStatsWithCounts(TestCase): return npu_counts def test_batch_norm_gather_stats_with_counts(self, device="npu"): + np.random.seed(1234) shape_format = [ [[np.float16, -1, [2, 3, 12, 12]], [np.float32, -1, [4, 3]], [np.float32, -1, [4, 3]], \ [np.float32, -1, [3]], [np.float32, -1, [3]], 1e-3, 1e-5, [np.float32, -1, [4]], 0], diff --git a/test/test_network_ops/test_npu_giou_backward.py b/test/test_network_ops/test_npu_giou_backward.py index 2176fde593a..66db6588441 100644 --- a/test/test_network_ops/test_npu_giou_backward.py +++ b/test/test_network_ops/test_npu_giou_backward.py @@ -53,6 +53,7 @@ class TestNpuGiouBackward(TestCase): return output, box1_grad, box2_grad def test_npu_giou_backward_shape_format(self): + np.random.seed(1234) shape_list1 = [ [1, 1] ] -- Gitee