Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions onnxruntime/core/graph/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,12 @@
ORT_THROW("This is an invalid model. Tensor does not have type information.");
}

if (utils::HasDataType(tensor) && (tensor.data_type() < TensorProto_DataType_DataType_ARRAYSIZE)) {
// all initializers must have a valid data type
if (!utils::HasDataType(tensor) || !tensor.DataType_IsValid(tensor.data_type())) {
ORT_THROW("This is an invalid model. Tensor '", tensor.name(), "' does not have valid data type.");
}

if ((tensor.data_type() < TensorProto_DataType_DataType_ARRAYSIZE)) {
weight_data_type_freq_[tensor.data_type()]++;
}

Expand Down Expand Up @@ -1669,16 +1674,17 @@

#if !defined(ORT_MINIMAL_BUILD)
GSL_SUPPRESS(es .84) // ignoring return value from unordered_map::insert causes noisy complaint
Status Graph::BuildConnections(std::unordered_set<std::string>& outer_scope_node_args_consumed) {
Status Graph::BuildConnections(std::unordered_set<std::string>& outer_scope_node_args_consumed,

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'

Check failure on line 1677 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'onnxruntime::common::Status onnxruntime::Graph::BuildConnections(std::unordered_set<std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::string>> &,bool &)': overloaded member function not found in 'onnxruntime::Graph'
bool& removed_node_with_subgraph) {
// recurse into subgraphs first so we can update any nodes in this graph that are used by those subgraphs
if (!resolve_context_.nodes_with_subgraphs.empty()) {
for (auto* node : resolve_context_.nodes_with_subgraphs) {

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'node': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

syntax error: missing ';' before ')'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

syntax error: missing ';' before ':'

Check failure on line 1681 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'node': a symbol whose type contains 'auto' must have an initializer
for (auto& subgraph : node->MutableSubgraphs()) {

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'subgraph': references must be initialized

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

syntax error: missing ';' before ')'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

syntax error: missing ';' before ':'

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'subgraph': a symbol whose type contains 'auto' must have an initializer

Check failure on line 1682 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'subgraph': references must be initialized
std::unordered_set<std::string> node_args_consumed;
ORT_RETURN_IF_ERROR(subgraph->BuildConnections(node_args_consumed));
ORT_RETURN_IF_ERROR(subgraph->BuildConnections(node_args_consumed, removed_node_with_subgraph));

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'_status': cannot be used before it is initialized

Check failure on line 1684 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'_status': cannot be used before it is initialized

for (auto& node_arg_name : node_args_consumed) {
auto node_arg = GetNodeArg(node_arg_name);

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_ep_generic_interface

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x86_release

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_vitisai

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_debug

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / build_x64_release_xnnpack

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / Windows GPU DML CI Pipeline

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, dynamic)

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (novcpkg, static)

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, static)

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

Check failure on line 1687 in onnxruntime/core/graph/graph.cc

View workflow job for this annotation

GitHub Actions / webgpu_build_x64_RelWithDebInfo (vcpkg, dynamic)

'onnxruntime::Graph::GetNodeArg': ambiguous call to overloaded function

if (node_arg == nullptr) {
// it's a node arg from outside this graph's scope, so add that to the list we return
Expand Down Expand Up @@ -1805,6 +1811,10 @@
} else if (node.OutputDefs().empty()) {
// This is a useless node.
// It has no input/output.
if (node.ContainsSubgraph()) {
removed_node_with_subgraph = true;
}

RemoveNode(node.Index());
}
}
Expand Down Expand Up @@ -3683,10 +3693,17 @@
std::unordered_set<std::string> outer_scope_node_args_consumed;

// recursively build connections between nodes in this graph and all subgraphs
ORT_RETURN_IF_ERROR(BuildConnections(outer_scope_node_args_consumed));
bool removed_node_with_subgraph = false;
ORT_RETURN_IF_ERROR(BuildConnections(outer_scope_node_args_consumed, removed_node_with_subgraph));
ORT_ENFORCE(outer_scope_node_args_consumed.empty(),
"Shouldn't be possible to have NodeArgs that haven't been handled already.");

// if we removed any nodes with subgraphs, we need to refresh the list of subgraphs.
if (removed_node_with_subgraph) {
all_subgraphs.clear();
FindAllSubgraphs(all_subgraphs);
}

// topological sort of this and any subgraphs is non-recursive
auto topo_sort_func = [](Graph& graph) { return graph.PerformTopologicalSortAndCheckIsAcyclic(); };
ORT_RETURN_IF_ERROR(ForThisAndAllSubgraphs(all_subgraphs, topo_sort_func));
Expand Down
10 changes: 6 additions & 4 deletions onnxruntime/core/session/custom_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1257,11 +1257,12 @@ common::Status CreateCustomRegistry(gsl::span<OrtCustomOpDomain* const> op_domai
std::unordered_map<std::string, std::vector<const OrtCustomOp*>> domain_kernels;
for (const auto* op : domain->custom_ops_) {
// define kernel
auto it = domain_kernels.find(op->GetName(op));
const auto* name = op->GetName(op);
auto it = domain_kernels.find(name);
if (it == domain_kernels.end()) {
domain_kernels[op->GetName(op)] = {op};
domain_kernels[name] = {op};
} else {
domain_kernels[op->GetName(op)].push_back(op);
domain_kernels[name].push_back(op);
}
}

Expand All @@ -1276,7 +1277,8 @@ common::Status CreateCustomRegistry(gsl::span<OrtCustomOpDomain* const> op_domai
for (const auto* op : ops) {
// define kernel
auto kernel_create_info = CreateKernelCreateInfo(domain->domain_, op);
kernel_def_map[op->GetName(op)].push_back(kernel_create_info.kernel_def.get());
const auto* op_name = op->GetName(op);
kernel_def_map[op_name].push_back(kernel_create_info.kernel_def.get());
ORT_RETURN_IF_ERROR(output->RegisterCustomKernel(kernel_create_info));
// If IsCompatible returns false, then all custom operators named
// 'op->GetName(op)' are not compatible among themselves.
Expand Down
21 changes: 21 additions & 0 deletions onnxruntime/test/framework/inference_session_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3069,5 +3069,26 @@ TEST(InferenceSessionTests, InterThreadPoolWithDenormalAsZero) {
}
#endif

TEST(InferenceSessionTests, BadDataTypeInInitializerIsHandled) {
// model has an initializer with a bogus data type. Graph ctor should detect and throw.
auto model_uri = ORT_TSTR("testdata/msrc-31000000518082.onnx");

SessionOptions so;
so.session_logid = "TempTest.LoadModel";
InferenceSession session{so, GetEnvironment()};
ASSERT_STATUS_NOT_OK_AND_HAS_SUBSTR(session.Load(model_uri), "does not have valid data type");
}

TEST(InferenceSessionTests, GraphResolveHandlesNodeWithSubgraphBeingRemoved) {
// model has a subgraph with output that is not consumed. the node with the subgraph should get removed in
// Graph::BuildConnections and Graph::Resolve should adjust its list of subgraphs to not access the removed subgraph.
auto model_uri = ORT_TSTR("testdata/msrc-31000000518483.onnx");

SessionOptions so;
so.session_logid = "TempTest.LoadModel";
InferenceSession session{so, GetEnvironment()};
ASSERT_STATUS_OK(session.Load(model_uri));
}

} // namespace test
} // namespace onnxruntime
Binary file added onnxruntime/test/testdata/msrc-31000000518082.onnx
Binary file not shown.
Binary file added onnxruntime/test/testdata/msrc-31000000518483.onnx
Binary file not shown.
53 changes: 53 additions & 0 deletions onnxruntime/test/testdata/msrc-31000000518483.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import onnx
from onnx import TensorProto, helper

# Add node with a subgraph that has no inputs or outputs.
# Graph::BuildConnections should remove and the list of subgraphs in Graph::Resolve should be updated.
# Other details here don't matter. Copied from ort_github_issue_10305.py
if_body = helper.make_graph(
[
# need to use main_graph_initializer in a way that can't be constant folded
helper.make_node("Constant", inputs=[], outputs=["zero"], name="Constant", value_int=0),
],
"if_branch_body",
[
# no explicit inputs
],
[
helper.make_tensor_value_info("zero", TensorProto.BOOL, [1]),
],
)

# Create the main graph
graph_proto = helper.make_graph(
[
# add a Transpose that can be moved past the Slice
helper.make_node(
"Transpose",
inputs=["input:0"],
outputs=["transpose:0"],
name="transpose0",
perm=[1, 0, 2],
),
helper.make_node(
"If",
[],
[],
"If1",
then_branch=if_body,
else_branch=if_body,
),
],
"Main_graph",
[
helper.make_tensor_value_info("input:0", TensorProto.FLOAT, [2, 2, 2]),
helper.make_tensor_value_info("state_var_in", TensorProto.FLOAT, [1]),
],
[
helper.make_tensor_value_info("transpose:0", TensorProto.FLOAT, [2, 2]),
],
)

model = helper.make_model(graph_proto)
# onnx.checker.check_model(model, True)
onnx.save(model, "msrc-31000000518483.onnx")
Loading