diff --git a/onnxruntime/core/providers/cpu/tensor/upsample.h b/onnxruntime/core/providers/cpu/tensor/upsample.h index 875b09fbaa..a7b3a77214 100644 --- a/onnxruntime/core/providers/cpu/tensor/upsample.h +++ b/onnxruntime/core/providers/cpu/tensor/upsample.h @@ -69,8 +69,8 @@ class UpsampleBase { ? info.GetAttrOrDefault("coordinate_transformation_mode", "half_pixel") : "asymmetric"; coordinate_transform_mode_ = StringToCoordinateTransformationMode(coordinate_transform_mode_name); - if (opset >= 13) { - LOGS(onnxruntime::logging::LoggingManager::DefaultLogger(), WARNING) + if (opset >= 13 && coordinate_transform_mode_ == TF_HALF_PIXEL_FOR_NN) { + LOGS_DEFAULT(WARNING) << "`tf_half_pixel_for_nn` is deprecated since opset 13, " << "yet this opset " << opset << " model uses the deprecated attribute"; }