Make PythonOp report dtype mismatch by name, instead of by using enum index (#13007)

This commit is contained in:
cloudhan 2022-09-20 12:29:30 +08:00 committed by GitHub
parent 77b567df66
commit 0ddf4efbd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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