[CPU] Fix the bug of gather kernel

This commit is contained in:
zhanyuan 2021-11-03 11:32:06 +08:00
parent ae1ebf1430
commit a5b416d0f4
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ void GatherV2CPUKernel<T>::ParallelRun(const int8_t *input_addr, const int *indi
std::vector<common::Task> tasks;
int thread_index = 0;
while (thread_index < thread_num) {
int count = SizeToInt(MSMIN(stride, outer_size - stride * IntToSize(thread_index)));
int count = MSMIN(SizeToInt(stride), SizeToInt(outer_size) - SizeToInt(stride) * thread_index);
if (count <= 0) {
break;
}