4
4
#include < string>
5
5
6
6
#include < c10/core/MemoryFormat.h>
7
- #include < c10/util/irange.h>
8
7
9
8
#include < fbjni/ByteBuffer.h>
10
9
#include < fbjni/fbjni.h>
@@ -98,7 +97,7 @@ static at::Tensor newAtTensor(
98
97
std::vector<int64_t > shapeVec{};
99
98
shapeVec.reserve (rank);
100
99
auto numel = 1 ;
101
- for (const auto i : c10::irange ( rank) ) {
100
+ for (auto i = 0 ; i < rank; ++i ) {
102
101
shapeVec.push_back (shapeArr[i]);
103
102
numel *= shapeArr[i];
104
103
}
@@ -522,7 +521,7 @@ at::IValue JIValue::JIValueToAtIValue(
522
521
523
522
std::vector<at::IValue> elements;
524
523
elements.reserve (n);
525
- for (const auto i : c10::irange (n) ) {
524
+ for (auto i = 0 ; i < n; ++i ) {
526
525
auto jivalue_element = jarray->getElement (i);
527
526
auto element = JIValue::JIValueToAtIValue (jivalue_element);
528
527
elements.push_back (std::move (element));
@@ -536,7 +535,7 @@ at::IValue JIValue::JIValueToAtIValue(
536
535
size_t n = jArrayPinned.size ();
537
536
c10::List<bool > list{};
538
537
list.reserve (n);
539
- for (const auto i : c10::irange (n) ) {
538
+ for (size_t i = 0 ; i < n; ++i ) {
540
539
list.push_back (jArrayPinned[i]);
541
540
}
542
541
return at::IValue{std::move (list)};
@@ -548,7 +547,7 @@ at::IValue JIValue::JIValueToAtIValue(
548
547
size_t n = jArrayPinned.size ();
549
548
c10::List<int64_t > list{};
550
549
list.reserve (n);
551
- for (const auto i : c10::irange (n) ) {
550
+ for (size_t i = 0 ; i < n; ++i ) {
552
551
list.push_back (jArrayPinned[i]);
553
552
}
554
553
return at::IValue{std::move (list)};
@@ -560,7 +559,7 @@ at::IValue JIValue::JIValueToAtIValue(
560
559
size_t n = jArrayPinned.size ();
561
560
c10::List<double > list{};
562
561
list.reserve (n);
563
- for (const auto i : c10::irange (n) ) {
562
+ for (size_t i = 0 ; i < n; ++i ) {
564
563
list.push_back (jArrayPinned[i]);
565
564
}
566
565
return at::IValue{std::move (list)};
@@ -573,7 +572,7 @@ at::IValue JIValue::JIValueToAtIValue(
573
572
size_t n = jArray->size ();
574
573
c10::List<at::Tensor> list{};
575
574
list.reserve (n);
576
- for (const auto i : c10::irange (n) ) {
575
+ for (size_t i = 0 ; i < n; ++i ) {
577
576
list.push_back (
578
577
TensorHybrid::newAtTensorFromJTensor (jArray->getElement (i)));
579
578
}
@@ -595,7 +594,7 @@ at::IValue JIValue::JIValueToAtIValue(
595
594
c10::impl::GenericList list{c10::unshapedType (first_element.type ())};
596
595
list.reserve (n);
597
596
list.push_back (first_element);
598
- for (const auto i : c10::irange ( 1 , n) ) {
597
+ for (auto i = 1 ; i < n; ++i ) {
599
598
auto jivalue_element = jarray->getElement (i);
600
599
auto element = JIValue::JIValueToAtIValue (jivalue_element);
601
600
list.push_back (element);
0 commit comments