Fixing bugs in ORT_NO_EXCEPTIONS (#9479)

ORT_NO_EXCEPTIONS is not working after the latest changes in:

onnxruntime/core/graph/function.cc
onnxruntime/core/graph/graph.cc
This commit is contained in:
Ginés Hidalgo 2021-10-26 13:50:32 -04:00 committed by GitHub
parent 1aabba7120
commit a036cc6d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -276,7 +276,10 @@ static void InitNestedModelLocalFunction(onnxruntime::Graph& graph,
}
ORT_CATCH(const std::exception& e) {
LOGS(logger, WARNING) << "Function body initialization failed for Function '"
<< onnx_function_proto.name() << "'. Error message " << e.what()
<< onnx_function_proto.name()
#ifndef ORT_NO_EXCEPTIONS
<< "'. Error message " << e.what()
#endif //ORT_NO_EXCEPTIONS
<< ". Execution will fail if ORT does not have a specialized kernel for this op";
// Return without using this function op's expansion. No need to fail just yet.
// If ORT has a specialized kernel for this op then execution will proceed

View file

@ -2537,7 +2537,9 @@ void Graph::InitFunctionBodyForNode(Node& node) {
ORT_CATCH(const std::exception& e) {
LOGS(logger_, WARNING) << "Function body initialization failed for node '"
<< node.Name() << "' optype " << node.OpType()
#ifndef ORT_NO_EXCEPTIONS
<< ". Error message " << e.what()
#endif //ORT_NO_EXCEPTIONS
<< ". Execution will fail if ORT does not have a specialized kernel for this op";
// Return without using this function op's expansion. No need to fail just yet.
// If ORT has a specialized kernel for this op then execution will proceed