mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
expose graph node name returning non-zero status code (#714)
* Initial commit
This commit is contained in:
parent
f4021cf30a
commit
ffd9071168
2 changed files with 18 additions and 2 deletions
|
|
@ -152,7 +152,11 @@ namespace Microsoft.ML.OnnxRuntime.Tests
|
|||
var tensor = new DenseTensor<float>(inputData, new int[] { 1, 3 });
|
||||
container.Add(NamedOnnxValue.CreateFromTensor<float>("data_0", tensor));
|
||||
var ex = Assert.Throws<OnnxRuntimeException>(() => session.Run(container));
|
||||
Assert.Equal("[ErrorCode:Fail] X num_dims does not match W num_dims. X: {1,3} W: {64,3,3,3}", ex.Message);
|
||||
Assert.True(
|
||||
!string.IsNullOrEmpty(ex.Message) &&
|
||||
ex.Message.StartsWith("[ErrorCode:Fail]") &&
|
||||
ex.Message.Contains("X num_dims does not match W num_dims. X: {1,3} W: {64,3,3,3}")
|
||||
);
|
||||
session.Dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include "core/common/common.h"
|
||||
#include "core/common/logging/logging.h"
|
||||
#include "core/framework/allocation_planner.h"
|
||||
|
|
@ -112,7 +113,18 @@ Status SequentialExecutor::Execute(const SessionState& session_state,
|
|||
|
||||
kernel_begin_time = session_state.Profiler().StartTime();
|
||||
}
|
||||
ORT_RETURN_IF_ERROR(p_op_kernel->Compute(&op_kernel_context));
|
||||
|
||||
const auto& compute_status = p_op_kernel->Compute(&op_kernel_context);
|
||||
if (!compute_status.IsOK()) {
|
||||
std::ostringstream ss;
|
||||
ss << "Non-zero status code returned while running Node: " <<
|
||||
p_op_kernel->Node().Name() <<
|
||||
" Status Message: " <<
|
||||
compute_status.ErrorMessage();
|
||||
const auto msg_string = ss.str();
|
||||
LOGS(logger, ERROR) << msg_string;
|
||||
return Status(compute_status.Category(), compute_status.Code(), msg_string);
|
||||
}
|
||||
|
||||
if (f_profiler_enabled) {
|
||||
session_state.Profiler().EndTimeAndRecordEvent(profiling::NODE_EVENT,
|
||||
|
|
|
|||
Loading…
Reference in a new issue