mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
Fix two compiler warnings (#4263)
This commit is contained in:
parent
5d773ee57b
commit
e505faa022
2 changed files with 5 additions and 4 deletions
|
|
@ -32,7 +32,8 @@ static void FindMinAndMaxNodeIndex(const TValidNodes& nodes, NodeIndex& min, Nod
|
|||
std::for_each(nodes.cbegin(), nodes.cend(), [&min, &max](const Node& node) {
|
||||
auto idx = node.Index();
|
||||
if (idx > max) max = idx;
|
||||
if (idx >= 0 && idx < min) min = idx;
|
||||
//NodeIndex is size_t type
|
||||
if (idx < min) min = idx;
|
||||
});
|
||||
|
||||
// match GraphViewer::MaxNodeIndex() which returns nodes_.size(), so is actually the max used value + 1.
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ Status ScatterNDBase::PrepareForCompute(OpKernelContext* context, Prepare& p) co
|
|||
if (update_rank < indice_rank - 1) {
|
||||
return true;
|
||||
}
|
||||
if ((update_rank >= indice_rank - 1) &&
|
||||
(indice_rank - 1 >= 0) &&
|
||||
if (update_rank >= indice_rank - 1 &&
|
||||
indice_rank >= 1 &&
|
||||
(indice_shape.Slice(0, indice_rank - 1) != update_shape.Slice(0, indice_rank - 1))) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -154,4 +154,4 @@ Status ScatterND::ScatterString(const Prepare& p, concurrency::ThreadPool* tp) c
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
} // namespace onnxruntime
|
||||
} // namespace onnxruntime
|
||||
|
|
|
|||
Loading…
Reference in a new issue