Revert D30652629: use irange for loops

Test Plan: revert-hammer

Differential Revision:
D30652629 (https://github.com/pytorch/pytorch/commit/687c2267d4dfb69138483f90deb4d4f5921a2965)

Original commit changeset: 0ae6c4bbbb55

fbshipit-source-id: 5c4f067b584a021c8c9656454d1ee60999600fb3
This commit is contained in:
Xue Li
2021-10-15 15:19:28 -07:00
committed by Facebook GitHub Bot
parent 1e2b2ee5ff
commit 2f099c7555
487 changed files with 21930 additions and 22184 deletions
+3 -4
View File
@@ -2,7 +2,6 @@
#include <torch/torch.h>
#include <ATen/native/Pow.h>
#include <c10/util/irange.h>
#include <torch/types.h>
#include <torch/utils.h>
#include <test/cpp/api/support.h>
@@ -25,7 +24,7 @@ TEST_F(DispatchTest, TestAVX2) {
setenv("ATEN_CPU_CAPABILITY", "avx2", 1);
#endif
const auto actual_pow_avx2 = vals_tensor.pow(pows_tensor);
for (const auto i : c10::irange(4)) {
for (int i = 0; i < 4; i++) {
ASSERT_EQ(result[i], actual_pow_avx2[i].item<int>());
}
}
@@ -41,7 +40,7 @@ TEST_F(DispatchTest, TestAVX512) {
setenv("ATEN_CPU_CAPABILITY", "avx512", 1);
#endif
const auto actual_pow_avx512 = vals_tensor.pow(pows_tensor);
for (const auto i : c10::irange(4)) {
for (int i = 0; i < 4; i++) {
ASSERT_EQ(result[i], actual_pow_avx512[i].item<int>());
}
}
@@ -57,7 +56,7 @@ TEST_F(DispatchTest, TestDefault) {
setenv("ATEN_CPU_CAPABILITY", "default", 1);
#endif
const auto actual_pow_default = vals_tensor.pow(pows_tensor);
for (const auto i : c10::irange(4)) {
for (int i = 0; i < 4; i++) {
ASSERT_EQ(result[i], actual_pow_default[i].item<int>());
}
}