Rename indices_is_order to rows_are_ordered

This commit is contained in:
aaa.jq 2020-07-04 03:28:21 +08:00 committed by GitHub
parent 1c73e5f20a
commit 277cb88cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,7 +118,7 @@ class SparseFillEmptyRowsOp : public OpKernel {
return; return;
} }
bool indices_is_order = true; bool rows_are_ordered = true;
int64 last_indices_row = 0; int64 last_indices_row = 0;
std::vector<int64> csr_offset(dense_rows, 0); std::vector<int64> csr_offset(dense_rows, 0);
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
@ -127,7 +127,7 @@ class SparseFillEmptyRowsOp : public OpKernel {
errors::InvalidArgument("indices(", i, ", 0) is invalid: ", errors::InvalidArgument("indices(", i, ", 0) is invalid: ",
row, " >= ", dense_rows)); row, " >= ", dense_rows));
++csr_offset[row]; ++csr_offset[row];
indices_is_order = indices_is_order & (row >= last_indices_row); rows_are_ordered = rows_are_ordered & (row >= last_indices_row);
last_indices_row = row; last_indices_row = row;
} }
bool all_rows_full = true; bool all_rows_full = true;
@ -151,7 +151,7 @@ class SparseFillEmptyRowsOp : public OpKernel {
} }
} }
if (all_rows_full && indices_is_order) { if (all_rows_full && rows_are_ordered) {
context->set_output(kOutputIndicesOutput, indices_t); context->set_output(kOutputIndicesOutput, indices_t);
context->set_output(kOutputValuesOutput, values_t); context->set_output(kOutputValuesOutput, values_t);
if (reverse_index_map) { if (reverse_index_map) {