// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include #include #include #include "core/graph/function_utils.h" #include "core/common/inlined_containers.h" #include "core/framework/tensorprotoutils.h" #include "onnx/shape_inference/implementation.h" #include "core/graph/function_impl.h" #include "core/graph/model_load_utils.h" namespace onnxruntime { namespace function_utils { using string = std::string; using namespace ONNX_NAMESPACE; namespace { bool AttributeContainsSubgraphs(const AttributeProto& attr) { return attr.has_g() || attr.graphs_size() > 0; } std::string FormatAttributeReferenceChain(const std::vector& active_attr_refs, const std::string& next_attr_ref) { std::ostringstream stream; for (size_t i = 0; i < active_attr_refs.size(); ++i) { if (i != 0) { stream << " -> "; } stream << active_attr_refs[i]; } if (!active_attr_refs.empty()) { stream << " -> "; } stream << next_attr_ref; return stream.str(); } } // namespace // Utilify function to get the imported version of domain from opset imports // Returns -1 if requested domain is not found in the opset_imports template