mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-06 00:03:22 +00:00
Fix sign-compare warnings with gcc
This commit is contained in:
parent
6625eecd09
commit
4ace393bea
3 changed files with 3 additions and 3 deletions
|
|
@ -2459,7 +2459,7 @@ Status Graph::SetGraphInputsOutputs() {
|
|||
// calling private ctor
|
||||
GSL_SUPPRESS(r .11)
|
||||
gsl::not_null<Node*> Graph::AllocateNode() {
|
||||
ORT_ENFORCE(nodes_.size() < std::numeric_limits<int>::max());
|
||||
ORT_ENFORCE(nodes_.size() < static_cast<unsigned int>(std::numeric_limits<int>::max()));
|
||||
std::unique_ptr<Node> new_node(new Node(nodes_.size(), *this));
|
||||
Node* node{new_node.get()};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Status UnsqueezeElimination::Apply(Graph& graph, Node& node, RewriteRuleEffect&
|
|||
ORT_ENFORCE(tensor_proto);
|
||||
|
||||
std::vector<int64_t> new_dims(axes.size() + tensor_proto->dims().size(), 0);
|
||||
if (new_dims.size() >= std::numeric_limits<int>::max()) {
|
||||
if (new_dims.size() >= static_cast<unsigned int>(std::numeric_limits<int>::max())) {
|
||||
return Status(ONNXRUNTIME, FAIL, "index out of range");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ EXECUTE_RESULT DataRunner::RunTaskImpl(size_t task_id) {
|
|||
output_names[i] = output_name;
|
||||
default_allocator->Free(output_name);
|
||||
}
|
||||
if (feeds.size() > std::numeric_limits<int>::max()) {
|
||||
if (feeds.size() > static_cast<unsigned int>(std::numeric_limits<int>::max())) {
|
||||
ORT_THROW("length overflow");
|
||||
}
|
||||
std::vector<const char*> input_names(feeds.size());
|
||||
|
|
|
|||
Loading…
Reference in a new issue