fix scatter-nd-binary LongToSize coredump issue

This commit is contained in:
dabaiji 2022-11-23 17:23:01 +08:00
parent 65ce2587b0
commit 34c00eaef5
1 changed files with 1 additions and 1 deletions

View File

@ -158,11 +158,11 @@ bool ScatterNdArithmeticCpuKernelMod::LaunchKernel(const std::vector<kernel::Add
size_t index_idx = batch_idx * slice_size_;
for (size_t i = 0; i < slice_size_; i++) {
auto index = indices[index_idx + i];
out_idx += batch_strides_[i] * LongToSize(index) * inner_size_;
if (index < 0 || index >= static_cast<S>(input_shape_[i])) {
invalid_index_pos = SizeToLong(index_idx);
break;
}
out_idx += batch_strides_[i] * LongToSize(index) * inner_size_;
}
if (invalid_index_pos != -1) {
break;