From a94c9bd88dc05a6d18c152722d4ee7eb80b6a409 Mon Sep 17 00:00:00 2001 From: Yang Chen <40417152+yangchen-MS@users.noreply.github.com> Date: Tue, 8 Oct 2019 09:31:35 -0700 Subject: [PATCH] throw exception using dmlc::LogMessageFatal (#2033) * throw exception using dmlc::LogMessageFatal On windows, ORT_THROW couldn't be caught if the exception was thrown from a jitted functions. Let's call dmlc::LogMessageFatal instead. * address CR use LOG(FATAL) --- .../core/providers/nuphar/mti_x86/tensor/scatter.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/onnxruntime/core/providers/nuphar/mti_x86/tensor/scatter.cc b/onnxruntime/core/providers/nuphar/mti_x86/tensor/scatter.cc index 5bf0ecca76..408a6e5435 100644 --- a/onnxruntime/core/providers/nuphar/mti_x86/tensor/scatter.cc +++ b/onnxruntime/core/providers/nuphar/mti_x86/tensor/scatter.cc @@ -37,8 +37,9 @@ void ScatterCommon(tvm::TVMArgs args, tvm::TVMRetValue* /*ret*/) { for (int i = 0; i < num_dims; i++) { if (indices->shape[i] != updates->shape[i]) { - ORT_THROW("Indices vs updates dimensions differs at position=", i, - " ", indices->shape[i], " vs ", updates->shape[i]); + LOG(FATAL) << + "Indices vs updates dimensions differs at position=" << + i << " " << indices->shape[i] << " vs " << updates->shape[i]; } } @@ -53,9 +54,10 @@ void ScatterCommon(tvm::TVMArgs args, tvm::TVMRetValue* /*ret*/) { if (idx >= -axis_size && idx < axis_size) { indices_data_vec[i] = idx >= 0 ? idx : idx + static_cast(axis_size); } else { - ORT_THROW("indices element out of data bounds, idx=", idx, - " must be within the inclusive range [", -axis_size, - ",", axis_size - 1, "]"); + LOG(FATAL) << + "indices element out of data bounds, idx=" << idx << + " must be within the inclusive range [" << -axis_size << + "," << axis_size - 1 << "]"; } }