diff --git a/onnxruntime/core/framework/tensorprotoutils.h b/onnxruntime/core/framework/tensorprotoutils.h index ed426d2849866..700e4f380a5db 100644 --- a/onnxruntime/core/framework/tensorprotoutils.h +++ b/onnxruntime/core/framework/tensorprotoutils.h @@ -309,9 +309,6 @@ inline const ONNX_NAMESPACE::TensorShapeProto& GetShape(const ONNX_NAMESPACE::Ty template const std::vector ParseData(const ONNX_NAMESPACE::TensorProto& ten_proto); -template -const T ParseScalar(const ONNX_NAMESPACE::TensorProto& ten_proto); - inline bool HasRawData(const ONNX_NAMESPACE::TensorProto& ten_proto) { // Can not be UNDEFINED and can not be STRING but test for STRING is usually performed separately // to return an error diff --git a/onnxruntime/core/providers/cpu/ml/label_encoder.h b/onnxruntime/core/providers/cpu/ml/label_encoder.h index e888581766d21..9d4e762a22903 100644 --- a/onnxruntime/core/providers/cpu/ml/label_encoder.h +++ b/onnxruntime/core/providers/cpu/ml/label_encoder.h @@ -152,14 +152,15 @@ class LabelEncoder_4 final : public OpKernel { } } Status Compute(OpKernelContext* context) const override { - const auto* tensor_pointer = context->Input(0); - if (tensor_pointer == nullptr) return Status(common::ONNXRUNTIME, common::FAIL, "input count mismatch"); - const Tensor& X = *tensor_pointer; - const TensorShape& shape = X.Shape(); - Tensor& Y = *context->Output(0, shape); + const auto* X = context->Input(0); + if (nullptr == X) { + return Status(common::ONNXRUNTIME, common::FAIL, "input count mismatch"); + } + const TensorShape& shape = X->Shape(); + auto* Y = context->Output(0, shape); - auto input = X.template DataAsSpan(); - auto output = Y.template MutableDataAsSpan(); + auto input = X->template DataAsSpan(); + auto output = Y->template MutableDataAsSpan(); for (int64_t i = 0; i < shape.Size(); ++i) { const auto found = _map.find(input[onnxruntime::narrow(i)]); diff --git a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc index c142106ed506c..093ff69af9665 100644 --- a/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc +++ b/onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc @@ -235,10 +235,6 @@ "^test_resize_upsample_sizes_nearest_not_larger_cuda", "^test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_cuda", // onnx 1.15 (opset 20) new and updated op tests - "^test_ai_onnx_ml_label_encoder_string_int", - "^test_ai_onnx_ml_label_encoder_string_int_no_default", - "^test_ai_onnx_ml_label_encoder_tensor_mapping", - "^test_ai_onnx_ml_label_encoder_tensor_value_only_mapping", "^test_gridsample_aligncorners_true", "^test_gridsample_bicubic_align_corners_0_additional_1", "^test_gridsample_bicubic_align_corners_1_additional_1",