Skip to content

Commit

Permalink
Fix if returned index exceeds 32-bit in TensileLite client (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
KKyang authored Jan 14, 2025
1 parent 579164a commit ce603f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ namespace TensileLite
if(indices[i] >= m_sizes[i])
throw std::runtime_error("Index out of bounds.");

return std::inner_product(indices.begin(), indices.end(), m_strides.begin(), 0);
return std::inner_product(indices.begin(), indices.end(), m_strides.begin(), (size_t)0);
}

template <typename T>
Expand All @@ -385,7 +385,7 @@ namespace TensileLite
if(*i.first >= *i.second)
throw std::runtime_error("Index out of bounds.");

return std::inner_product(indices.begin(), indices.end(), m_strides.begin(), 0);
return std::inner_product(indices.begin(), indices.end(), m_strides.begin(), (size_t)0);
}

template <class... Ts,
Expand Down

0 comments on commit ce603f2

Please sign in to comment.