From 41d03580b44f23e5ad6dac55b0f2467f89db376a Mon Sep 17 00:00:00 2001 From: zhoufan37 Date: Tue, 22 Mar 2022 16:16:38 +0800 Subject: [PATCH] modified codecheckkmr Operator --- test/test_network_ops/test_normalize_batch.py | 2 +- test/test_network_ops/test_npu_giou.py | 2 +- test/test_network_ops/test_npu_giou_backward.py | 2 +- test/test_network_ops/test_npu_linear.py | 3 ++- test/test_network_ops/test_npu_linear_backward.py | 2 +- test/test_network_ops/test_npu_pad.py | 2 +- test/test_network_ops/test_ones.py | 2 +- test/test_network_ops/test_pdist.py | 2 +- test/test_network_ops/test_prelu.py | 2 +- test/test_network_ops/test_prelu_backward.py | 2 +- test/test_network_ops/test_prod.py | 2 +- test/test_network_ops/test_put.py | 2 +- test/test_network_ops/test_qr.py | 2 +- test/test_network_ops/test_quantize_per_channel.py | 2 +- test/test_network_ops/test_quantize_per_tensor.py | 2 +- test/test_network_ops/test_random_choice_with_mask.py | 2 +- test/test_network_ops/test_randperm.py | 2 +- test/test_network_ops/test_reflection_pad1d.py | 2 +- test/test_network_ops/test_reflection_pad2d.py | 2 +- test/test_network_ops/test_reflection_pad2d_backward.py | 2 +- test/test_network_ops/test_remainder.py | 3 ++- test/test_network_ops/test_renorm.py | 2 +- test/test_network_ops/test_repeat.py | 2 +- test/test_network_ops/test_repeat_interleave.py | 2 +- test/test_network_ops/test_replication_pad1d.py | 2 +- test/test_network_ops/test_replication_pad2d.py | 2 +- test/test_network_ops/test_replication_pad2d_backward.py | 2 +- test/test_network_ops/test_reshape.py | 2 +- test/test_network_ops/test_roi_align_backward.py | 3 ++- test/test_network_ops/test_roll.py | 2 +- test/test_network_ops/test_roll_6d.py | 2 +- test/test_network_ops/test_rotated_iou.py | 2 +- test/test_network_ops/test_rotated_overlaps.py | 2 +- test/test_network_ops/test_round.py | 2 +- test/test_network_ops/test_rrelu_with_noise.py | 2 +- test/test_network_ops/test_rrelu_with_noise_backward.py | 2 +- test/test_network_ops/test_rsqrt.py | 2 +- test/test_network_ops/test_rsub.py | 3 ++- 38 files changed, 42 insertions(+), 38 deletions(-) diff --git a/test/test_network_ops/test_normalize_batch.py b/test/test_network_ops/test_normalize_batch.py index 2c84fc8a91..93e2042dfa 100644 --- a/test/test_network_ops/test_normalize_batch.py +++ b/test/test_network_ops/test_normalize_batch.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_npu_giou.py b/test/test_network_ops/test_npu_giou.py index 2581c89234..0f3c584237 100644 --- a/test/test_network_ops/test_npu_giou.py +++ b/test/test_network_ops/test_npu_giou.py @@ -16,8 +16,8 @@ import math import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_npu_giou_backward.py b/test/test_network_ops/test_npu_giou_backward.py index 1e6cde0bd6..2176fde593 100644 --- a/test/test_network_ops/test_npu_giou_backward.py +++ b/test/test_network_ops/test_npu_giou_backward.py @@ -16,8 +16,8 @@ import math import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_npu_linear.py b/test/test_network_ops/test_npu_linear.py index 45e66980d7..d9d4b022e2 100644 --- a/test/test_network_ops/test_npu_linear.py +++ b/test/test_network_ops/test_npu_linear.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_npu_linear_backward.py b/test/test_network_ops/test_npu_linear_backward.py index b7f6a1cf1c..252bf651eb 100644 --- a/test/test_network_ops/test_npu_linear_backward.py +++ b/test/test_network_ops/test_npu_linear_backward.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_npu_pad.py b/test/test_network_ops/test_npu_pad.py index 5ff36c7a99..83cbfac5e8 100644 --- a/test/test_network_ops/test_npu_pad.py +++ b/test/test_network_ops/test_npu_pad.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_ones.py b/test/test_network_ops/test_ones.py index 1c08ec9b4b..a78e30b7a4 100644 --- a/test/test_network_ops/test_ones.py +++ b/test/test_network_ops/test_ones.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu from torch.nn import functional as F +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_pdist.py b/test/test_network_ops/test_pdist.py index 90596e1f44..d08e7ea5bf 100644 --- a/test/test_network_ops/test_pdist.py +++ b/test/test_network_ops/test_pdist.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_prelu.py b/test/test_network_ops/test_prelu.py index bf4885dbe4..dd23be5c77 100644 --- a/test/test_network_ops/test_prelu.py +++ b/test/test_network_ops/test_prelu.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_prelu_backward.py b/test/test_network_ops/test_prelu_backward.py index 0e42898525..af8086cbe8 100644 --- a/test/test_network_ops/test_prelu_backward.py +++ b/test/test_network_ops/test_prelu_backward.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_prod.py b/test/test_network_ops/test_prod.py index 3ac716b90d..0f8f6c879a 100644 --- a/test/test_network_ops/test_prod.py +++ b/test/test_network_ops/test_prod.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_put.py b/test/test_network_ops/test_put.py index ec1463426b..5a852b7b88 100644 --- a/test/test_network_ops/test_put.py +++ b/test/test_network_ops/test_put.py @@ -14,8 +14,8 @@ import copy import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_qr.py b/test/test_network_ops/test_qr.py index cc527b272d..305ace812d 100644 --- a/test/test_network_ops/test_qr.py +++ b/test/test_network_ops/test_qr.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_quantize_per_channel.py b/test/test_network_ops/test_quantize_per_channel.py index f04463256c..fece13b229 100644 --- a/test/test_network_ops/test_quantize_per_channel.py +++ b/test/test_network_ops/test_quantize_per_channel.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_quantize_per_tensor.py b/test/test_network_ops/test_quantize_per_tensor.py index c7af4231fc..028ea64826 100644 --- a/test/test_network_ops/test_quantize_per_tensor.py +++ b/test/test_network_ops/test_quantize_per_tensor.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_random_choice_with_mask.py b/test/test_network_ops/test_random_choice_with_mask.py index 9d79606f92..8d4cdfafd5 100644 --- a/test/test_network_ops/test_random_choice_with_mask.py +++ b/test/test_network_ops/test_random_choice_with_mask.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_randperm.py b/test/test_network_ops/test_randperm.py index 0c1ae3b7c1..21684a5196 100644 --- a/test/test_network_ops/test_randperm.py +++ b/test/test_network_ops/test_randperm.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_reflection_pad1d.py b/test/test_network_ops/test_reflection_pad1d.py index 7f39ebe8c7..65abd45574 100644 --- a/test/test_network_ops/test_reflection_pad1d.py +++ b/test/test_network_ops/test_reflection_pad1d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_reflection_pad2d.py b/test/test_network_ops/test_reflection_pad2d.py index 5fac72ead7..67bfc39d04 100644 --- a/test/test_network_ops/test_reflection_pad2d.py +++ b/test/test_network_ops/test_reflection_pad2d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_reflection_pad2d_backward.py b/test/test_network_ops/test_reflection_pad2d_backward.py index e7285d48e8..7f7debffa2 100644 --- a/test/test_network_ops/test_reflection_pad2d_backward.py +++ b/test/test_network_ops/test_reflection_pad2d_backward.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_remainder.py b/test/test_network_ops/test_remainder.py index b28251efd0..101060d8e9 100644 --- a/test/test_network_ops/test_remainder.py +++ b/test/test_network_ops/test_remainder.py @@ -11,10 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import copy import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_renorm.py b/test/test_network_ops/test_renorm.py index b18f43e2a8..11e68ea718 100644 --- a/test/test_network_ops/test_renorm.py +++ b/test/test_network_ops/test_renorm.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_repeat.py b/test/test_network_ops/test_repeat.py index 85ada44a5a..9def975dc1 100644 --- a/test/test_network_ops/test_repeat.py +++ b/test/test_network_ops/test_repeat.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_repeat_interleave.py b/test/test_network_ops/test_repeat_interleave.py index b984c78b22..e7412ea759 100644 --- a/test/test_network_ops/test_repeat_interleave.py +++ b/test/test_network_ops/test_repeat_interleave.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_replication_pad1d.py b/test/test_network_ops/test_replication_pad1d.py index 7351909892..b69eaf0e09 100644 --- a/test/test_network_ops/test_replication_pad1d.py +++ b/test/test_network_ops/test_replication_pad1d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_replication_pad2d.py b/test/test_network_ops/test_replication_pad2d.py index d33248b1df..8834e0d98f 100644 --- a/test/test_network_ops/test_replication_pad2d.py +++ b/test/test_network_ops/test_replication_pad2d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_replication_pad2d_backward.py b/test/test_network_ops/test_replication_pad2d_backward.py index f6214dadbd..e5acdcc19a 100644 --- a/test/test_network_ops/test_replication_pad2d_backward.py +++ b/test/test_network_ops/test_replication_pad2d_backward.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_reshape.py b/test/test_network_ops/test_reshape.py index f600ddad26..ed6f06f0db 100644 --- a/test/test_network_ops/test_reshape.py +++ b/test/test_network_ops/test_reshape.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_roi_align_backward.py b/test/test_network_ops/test_roi_align_backward.py index 1aa732138f..50fcdd8733 100644 --- a/test/test_network_ops/test_roi_align_backward.py +++ b/test/test_network_ops/test_roi_align_backward.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_roll.py b/test/test_network_ops/test_roll.py index fe4ab0e8c2..8f83e8016f 100644 --- a/test/test_network_ops/test_roll.py +++ b/test/test_network_ops/test_roll.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_roll_6d.py b/test/test_network_ops/test_roll_6d.py index da6a7a633f..8699a910bb 100644 --- a/test/test_network_ops/test_roll_6d.py +++ b/test/test_network_ops/test_roll_6d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_rotated_iou.py b/test/test_network_ops/test_rotated_iou.py index b28fd33d39..bc2c27a3c3 100644 --- a/test/test_network_ops/test_rotated_iou.py +++ b/test/test_network_ops/test_rotated_iou.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_rotated_overlaps.py b/test/test_network_ops/test_rotated_overlaps.py index 035b748cd3..6ffe4d6a3b 100644 --- a/test/test_network_ops/test_rotated_overlaps.py +++ b/test/test_network_ops/test_rotated_overlaps.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_round.py b/test/test_network_ops/test_round.py index 7393d57ec3..0e7f5ddc20 100644 --- a/test/test_network_ops/test_round.py +++ b/test/test_network_ops/test_round.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_rrelu_with_noise.py b/test/test_network_ops/test_rrelu_with_noise.py index 28a904fd06..a27dfc6ac3 100644 --- a/test/test_network_ops/test_rrelu_with_noise.py +++ b/test/test_network_ops/test_rrelu_with_noise.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_rrelu_with_noise_backward.py b/test/test_network_ops/test_rrelu_with_noise_backward.py index e3ce328a9d..2c45ff7a0a 100644 --- a/test/test_network_ops/test_rrelu_with_noise_backward.py +++ b/test/test_network_ops/test_rrelu_with_noise_backward.py @@ -15,8 +15,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_rsqrt.py b/test/test_network_ops/test_rsqrt.py index 7fb9924135..c5fb54f263 100644 --- a/test/test_network_ops/test_rsqrt.py +++ b/test/test_network_ops/test_rsqrt.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor diff --git a/test/test_network_ops/test_rsub.py b/test/test_network_ops/test_rsub.py index 6cb8fd3574..0557a52717 100644 --- a/test/test_network_ops/test_rsub.py +++ b/test/test_network_ops/test_rsub.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import torch -import torch_npu import numpy as np +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests from torch_npu.testing.common_utils import create_common_tensor -- Gitee