From 0ddf4efbd966d4189eff6b05cd8d4dc3fa52be9a Mon Sep 17 00:00:00 2001 From: cloudhan Date: Tue, 20 Sep 2022 12:29:30 +0800 Subject: [PATCH] Make PythonOp report dtype mismatch by name, instead of by using enum index (#13007) --- orttraining/orttraining/core/graph/training_op_defs.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orttraining/orttraining/core/graph/training_op_defs.cc b/orttraining/orttraining/core/graph/training_op_defs.cc index 84ae3ffd48..c18a1000c8 100644 --- a/orttraining/orttraining/core/graph/training_op_defs.cc +++ b/orttraining/orttraining/core/graph/training_op_defs.cc @@ -3682,7 +3682,9 @@ Return true if all elements are true and false otherwise. ORT_ENFORCE(inferred_input_type->value_case() == TypeProto::kTensorType, "PythonOp's ", i, "th input type must be a tensor."); ORT_ENFORCE(inferred_input_type->tensor_type().elem_type() == input_tensor_types_proto->ints().at(i), - "PythonOp's ", i, "th input type must be ", input_tensor_types_proto->ints().at(i)); + "PythonOp's ", i, "th input type must be ", + TensorProto_DataType_Name(input_tensor_types_proto->ints().at(i)), " but got ", + TensorProto_DataType_Name(inferred_input_type->tensor_type().elem_type())); } // The first output is a pointer which points to