Commit 99117398 authored by rusty1s's avatar rusty1s
Browse files

replace auto

parent e0c91397
...@@ -9,17 +9,17 @@ torch::Tensor ind2ptr_cpu(torch::Tensor ind, int64_t M) { ...@@ -9,17 +9,17 @@ torch::Tensor ind2ptr_cpu(torch::Tensor ind, int64_t M) {
auto out_data = out.data_ptr<int64_t>(); auto out_data = out.data_ptr<int64_t>();
int64_t numel = ind.numel(), idx = ind_data[0], next_idx; int64_t numel = ind.numel(), idx = ind_data[0], next_idx;
for (auto i = 0; i <= idx; i++) for (int64_t i = 0; i <= idx; i++)
out_data[i] = 0; out_data[i] = 0;
for (auto i = 0; i < numel - 1; i++) { for (int64_t i = 0; i < numel - 1; i++) {
next_idx = ind_data[i + 1]; next_idx = ind_data[i + 1];
for (auto j = idx; j < next_idx; j++) for (int64_t j = idx; j < next_idx; j++)
out_data[j + 1] = i + 1; out_data[j + 1] = i + 1;
idx = next_idx; idx = next_idx;
} }
for (auto i = idx + 1; i < M + 1; i++) for (int64_t i = idx + 1; i < M + 1; i++)
out_data[i] = numel; out_data[i] = numel;
return out; return out;
...@@ -32,9 +32,9 @@ torch::Tensor ptr2ind_cpu(torch::Tensor ptr, int64_t E) { ...@@ -32,9 +32,9 @@ torch::Tensor ptr2ind_cpu(torch::Tensor ptr, int64_t E) {
auto out_data = out.data_ptr<int64_t>(); auto out_data = out.data_ptr<int64_t>();
int64_t idx = ptr_data[0], next_idx; int64_t idx = ptr_data[0], next_idx;
for (auto i = 0; i < ptr.numel() - 1; i++) { for (int64_t i = 0; i < ptr.numel() - 1; i++) {
next_idx = ptr_data[i + 1]; next_idx = ptr_data[i + 1];
for (auto e = idx; e < next_idx; e++) for (int64_t e = idx; e < next_idx; e++)
out_data[e] = i; out_data[e] = i;
idx = next_idx; idx = next_idx;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment