diff --git a/test/test_network_ops/test___and__.py b/test/test_network_ops/test___and__.py index 03017da32004ae7302952b4a8ec3fbf990b85b78..f65ebd2cd0f6ca1fca5b5fdd2ebf8d8c19bb7d3b 100644 --- a/test/test_network_ops/test___and__.py +++ b/test/test_network_ops/test___and__.py @@ -14,8 +14,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___ior__.py b/test/test_network_ops/test___ior__.py index 363aa108a81e125d6177a3c4ae7399ec4b1afca3..ae5488022ffb7fc292c174f4f37f065f6929b6d7 100644 --- a/test/test_network_ops/test___ior__.py +++ b/test/test_network_ops/test___ior__.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___or__.py b/test/test_network_ops/test___or__.py index 74bd6c8d277e226a5002be8f347bb58376fa5014..496c923852df0b3bdfe501dff92059256422cbd6 100644 --- a/test/test_network_ops/test___or__.py +++ b/test/test_network_ops/test___or__.py @@ -15,8 +15,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__iRshift__.py b/test/test_network_ops/test__iRshift__.py index aae06cf435e99c9d01bd7f6cf18d3e2d90744ef7..0fa5ddc870a5ba190f1a9c97b21ef335f15bf09f 100644 --- a/test/test_network_ops/test__iRshift__.py +++ b/test/test_network_ops/test__iRshift__.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__ilshift__.py b/test/test_network_ops/test__ilshift__.py index db2450246c7ad07345e0a2279e227afea91425c1..18f7906e276a922eb45d8fe103df46cdfe8a7db3 100644 --- a/test/test_network_ops/test__ilshift__.py +++ b/test/test_network_ops/test__ilshift__.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__rshift__.py b/test/test_network_ops/test__rshift__.py index 72409eb46653311762f9acb0613fdc84384eccd2..44e85af201c85b9607e93b4018ce898c50884c97 100644 --- a/test/test_network_ops/test__rshift__.py +++ b/test/test_network_ops/test__rshift__.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__svd_helper.py b/test/test_network_ops/test__svd_helper.py index da3b0e4a5a3034c9ee68d7ace448235bc49d2d96..9098310ec5e3e23f77daa463a75c693a7904003a 100644 --- a/test/test_network_ops/test__svd_helper.py +++ b/test/test_network_ops/test__svd_helper.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_abs.py b/test/test_network_ops/test_abs.py index e1e4de92c0691025266d26a00466b95ac85663aa..28db57266ef00b3f8811477309c281cb23aa4a5b 100644 --- a/test/test_network_ops/test_abs.py +++ b/test/test_network_ops/test_abs.py @@ -12,8 +12,8 @@ # 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_adaptive_avg_pool1d.py b/test/test_network_ops/test_adaptive_avg_pool1d.py index af129c3e5fd82d9e332ce85c13f402aed2ff938e..7390fcf2a5c5df07d1051cf558f4438f9c44e8cf 100644 --- a/test/test_network_ops/test_adaptive_avg_pool1d.py +++ b/test/test_network_ops/test_adaptive_avg_pool1d.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import torch.nn as nn 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_adaptive_avg_pool2d_backward.py b/test/test_network_ops/test_adaptive_avg_pool2d_backward.py index 7037973c859f8c7058f0eb09f3ce73e5a133aabc..0f9a67e6733682a3cb2ecc2a8e4a75a73280e44c 100644 --- a/test/test_network_ops/test_adaptive_avg_pool2d_backward.py +++ b/test/test_network_ops/test_adaptive_avg_pool2d_backward.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import numpy as np from torch.nn import functional as F +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_adaptive_avg_pool3d.py b/test/test_network_ops/test_adaptive_avg_pool3d.py index 83f39c5c183072a142bb2edf9912f6ba8ff6e988..e7c9eac1c3e3fba9336131d21865ede78de9afab 100644 --- a/test/test_network_ops/test_adaptive_avg_pool3d.py +++ b/test/test_network_ops/test_adaptive_avg_pool3d.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import torch.nn as nn 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_adaptive_avg_pool3d_backward.py b/test/test_network_ops/test_adaptive_avg_pool3d_backward.py index e5d3fde9f332a257c3effceb9817e4956077a31b..26bc5ad21cb812e84add19edb0190b5372c656ec 100644 --- a/test/test_network_ops/test_adaptive_avg_pool3d_backward.py +++ b/test/test_network_ops/test_adaptive_avg_pool3d_backward.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import numpy as np 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_adaptive_max_pool2d.py b/test/test_network_ops/test_adaptive_max_pool2d.py index 0cfe2c8417d1357bdeeef8bdd55dd900e955de71..1d4b4180cd119b3f165b326f716f8734a2136955 100644 --- a/test/test_network_ops/test_adaptive_max_pool2d.py +++ b/test/test_network_ops/test_adaptive_max_pool2d.py @@ -13,8 +13,8 @@ # limitations under the License. import torch.nn as nn -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_adaptive_max_pool2d_backward.py b/test/test_network_ops/test_adaptive_max_pool2d_backward.py index 8fb62a32d563353abcbc839b6c93010f28af25f0..11f2564cee76fb2a95d574a12d31d260c9adfe21 100644 --- a/test/test_network_ops/test_adaptive_max_pool2d_backward.py +++ b/test/test_network_ops/test_adaptive_max_pool2d_backward.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import torch.nn as nn 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_add.py b/test/test_network_ops/test_add.py index bc5c9a9c99975499cf8ecc8a173c773f7b75a384..8700e39e62dd028fc2a01280484c1880e6e44fc4 100644 --- a/test/test_network_ops/test_add.py +++ b/test/test_network_ops/test_add.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_addbmm.py b/test/test_network_ops/test_addbmm.py index 7b3a380146291596f237fecb51ddc9bcb0a7a75f..2e98155470293a3176e761ac0e0d02d67497067d 100644 --- a/test/test_network_ops/test_addbmm.py +++ b/test/test_network_ops/test_addbmm.py @@ -13,8 +13,8 @@ # 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_addmm.py b/test/test_network_ops/test_addmm.py index 58db41361ac7d12596980bd9c99145497ab5280c..06a849b74e20de02e7777942e057eefcbcb8c14f 100644 --- a/test/test_network_ops/test_addmm.py +++ b/test/test_network_ops/test_addmm.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_addmv.py b/test/test_network_ops/test_addmv.py index b59052a87c5d5382906ed866b223f3d29de81652..b0ae5f62b1deefe2fe80c0256f3ac4d4a85a9c3d 100644 --- a/test/test_network_ops/test_addmv.py +++ b/test/test_network_ops/test_addmv.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 @@ -22,7 +22,6 @@ from torch_npu.testing.common_utils import create_common_tensor class TestAddmv(TestCase): def cpu_op_exec(self, a, b, c, alpha, beta): - '''output = alpha * a @ b + beta * c''' output = torch.addmv(c, a, b, alpha=alpha, beta=beta) output = output.numpy() return output diff --git a/test/test_network_ops/test_addr.py b/test/test_network_ops/test_addr.py index 3d37459509a17300ee35214096ab9af462edd0cd..d1794d3f9ab3b45b7f787054bccd7fdfa75eecd2 100644 --- a/test/test_network_ops/test_addr.py +++ b/test/test_network_ops/test_addr.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_affine_grid_generator.py b/test/test_network_ops/test_affine_grid_generator.py index 1c62d975d7518e8b7128832794d2ac406ca6d1f0..6efa4604f86a16e22350a65f67f02fc5a6413a6c 100644 --- a/test/test_network_ops/test_affine_grid_generator.py +++ b/test/test_network_ops/test_affine_grid_generator.py @@ -15,9 +15,9 @@ # limitations under the License. import torch -import torch_npu import numpy as np from torch.nn import functional as F +import torch_npu from torch_npu.testing.testcase import TestCase, run_tests diff --git a/test/test_network_ops/test_affine_grid_generator_backward.py b/test/test_network_ops/test_affine_grid_generator_backward.py index e13250aaf008a79b22e2101406d7b4442579b65e..1f67e08a102c771d02e6303d5871471c78fc21d7 100644 --- a/test/test_network_ops/test_affine_grid_generator_backward.py +++ b/test/test_network_ops/test_affine_grid_generator_backward.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import numpy as np 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_all.py b/test/test_network_ops/test_all.py index df40ae454567838b5bdac9b7ea3944a2765e87ca..33bcd3d5744821b2294d7fefabe8562ed0a9bed1 100644 --- a/test/test_network_ops/test_all.py +++ b/test/test_network_ops/test_all.py @@ -12,8 +12,8 @@ # 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_anchorresponseflags.py b/test/test_network_ops/test_anchorresponseflags.py index 57847f467efc1e601a92b3b170b92ec368b86a82..8617af13359e9e2548363f1dd6347ae585e8ec56 100644 --- a/test/test_network_ops/test_anchorresponseflags.py +++ b/test/test_network_ops/test_anchorresponseflags.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. import torch -import torch_npu import numpy as np 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_any.py b/test/test_network_ops/test_any.py index 6a2a34a1963aff61a40a4cd6da208c50ac0c080d..08d1a7ad034fbaec348a92ee4513f2e380daddde 100644 --- a/test/test_network_ops/test_any.py +++ b/test/test_network_ops/test_any.py @@ -12,8 +12,8 @@ # 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_arange.py b/test/test_network_ops/test_arange.py index c4aa1a13e5dc571847467856d128a51e3b6d53c5..87f33cf0180525a01b378aa42475c28d07958d03 100644 --- a/test/test_network_ops/test_arange.py +++ b/test/test_network_ops/test_arange.py @@ -12,8 +12,8 @@ # 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_argmax.py b/test/test_network_ops/test_argmax.py index 5e0007727a8cff9e181d37666b62ae1fbe4fb6cb..aa88eba673f267eab966f27217fd800e9fd33e51 100644 --- a/test/test_network_ops/test_argmax.py +++ b/test/test_network_ops/test_argmax.py @@ -12,8 +12,8 @@ # 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_argmin.py b/test/test_network_ops/test_argmin.py index d63c756e0cabe33af0f51eee081bdc2695f32d5f..0fd639981dcaa13c22170efe8ff59e6b04620171 100644 --- a/test/test_network_ops/test_argmin.py +++ b/test/test_network_ops/test_argmin.py @@ -15,8 +15,8 @@ # coding: utf-8 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_argsort.py b/test/test_network_ops/test_argsort.py index e0fcfed5f8a964c93ed3e698ce5723a826a536c9..fae2234d97457855f66490ed7772e79270f43107 100644 --- a/test/test_network_ops/test_argsort.py +++ b/test/test_network_ops/test_argsort.py @@ -14,8 +14,8 @@ # 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_asin.py b/test/test_network_ops/test_asin.py index 45d014c759eeb85986f92a7c2d4c819004effe98..7026cf0410a8cc238739573085340ebc0e69899a 100644 --- a/test/test_network_ops/test_asin.py +++ b/test/test_network_ops/test_asin.py @@ -12,8 +12,8 @@ # 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_atan.py b/test/test_network_ops/test_atan.py index ad4289162208ebb7c7952ecf46bdfb67f5e8adb0..43d887e17a9c247debed28e3f20061b910bf31b3 100644 --- a/test/test_network_ops/test_atan.py +++ b/test/test_network_ops/test_atan.py @@ -14,8 +14,8 @@ # 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_atan2.py b/test/test_network_ops/test_atan2.py index bded83715fdbf83336de102487adb99f3e2729f8..161d53db6736fd8e64b1e9a99743a6f1ec4113cc 100644 --- a/test/test_network_ops/test_atan2.py +++ b/test/test_network_ops/test_atan2.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_avg_pool2d.py b/test/test_network_ops/test_avg_pool2d.py index 4d1c4e432be74d5d7a1bcb019a548ac0c83b8f8b..59d063db6708f82e482bf7c1dcfedc9031f20579 100644 --- a/test/test_network_ops/test_avg_pool2d.py +++ b/test/test_network_ops/test_avg_pool2d.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import torch.nn as nn 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_avg_pool2d_backward.py b/test/test_network_ops/test_avg_pool2d_backward.py index fb89146df2ee551923d1728df89896ad44b467a2..556ac656888ec717cc2e5ae568609007e402402e 100644 --- a/test/test_network_ops/test_avg_pool2d_backward.py +++ b/test/test_network_ops/test_avg_pool2d_backward.py @@ -13,9 +13,9 @@ # limitations under the License. import torch -import torch_npu import torch.nn as nn 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_avg_pool3d.py b/test/test_network_ops/test_avg_pool3d.py index dd8e3188f44865f496508fa3c27ae814a86d1c7c..fe16fc3e1747ec0c95d69ebe00092a684a748002 100644 --- a/test/test_network_ops/test_avg_pool3d.py +++ b/test/test_network_ops/test_avg_pool3d.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 @@ -40,7 +40,6 @@ class TestAvgPool3D(TestCase): return output_data def test_avg_pool_3d_fp32(self, device="npu"): - # shape_format:[[dtype, (input_shape)], kernel_size, stride] shape_format = [ [[np.float32, -1, (20, 16, 50, 44, 31)], (3, 2, 2), (2, 1, 2)], [[np.float32, -1, (2, 1, 4, 4, 4)], 3, 2], @@ -55,7 +54,6 @@ class TestAvgPool3D(TestCase): self.assertRtolEqual(cpu_output, npu_output.cpu(), 1.e-3) def test_avg_pool_3d_fp16(self, device="npu"): - # shape_format:[[dtype, (input_shape)], kernel_size, stride] shape_format = [ [[np.float16, -1, (20, 16, 50, 44, 31)], (3, 2, 2), (2, 1, 2)], [[np.float16, -1, (2, 1, 4, 4, 4)], 3, 2], diff --git a/test/test_network_ops/test_avg_pool3d_backward.py b/test/test_network_ops/test_avg_pool3d_backward.py index e86ecc7d2b57afad31e89bf164a73e64954c4982..4e399f6fe85945b6ff5d74070bfb4af33791c053 100644 --- a/test/test_network_ops/test_avg_pool3d_backward.py +++ b/test/test_network_ops/test_avg_pool3d_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