mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Revert D30652629: use irange for loops
Test Plan: revert-hammer
Differential Revision:
D30652629 (687c2267d4
)
Original commit changeset: 0ae6c4bbbb55
fbshipit-source-id: 5c4f067b584a021c8c9656454d1ee60999600fb3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1e2b2ee5ff
commit
2f099c7555
@ -1,4 +1,3 @@
|
||||
#include <c10/util/irange.h>
|
||||
#include <torch/script.h>
|
||||
#include <torch/cuda.h>
|
||||
|
||||
@ -45,7 +44,7 @@ void get_operator_from_registry_and_execute() {
|
||||
const auto manual = custom_op(torch::ones(5), 2.0, 3);
|
||||
|
||||
TORCH_INTERNAL_ASSERT(output.size() == 3);
|
||||
for (const auto i : c10::irange(output.size())) {
|
||||
for (size_t i = 0; i < output.size(); ++i) {
|
||||
TORCH_INTERNAL_ASSERT(output[i].allclose(torch::ones(5) * 2));
|
||||
TORCH_INTERNAL_ASSERT(output[i].allclose(manual[i]));
|
||||
}
|
||||
|
Reference in New Issue
Block a user