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)
This commit is contained in:
Yang Chen 2019-10-08 09:31:35 -07:00 committed by baowenlei
parent 19b0d0af87
commit a94c9bd88d

View file

@ -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<Tind>(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 << "]";
}
}