From d2b5ccc173a480f38c8014cc069b7a3cc170a799 Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Mon, 19 Aug 2024 06:47:44 -0700 Subject: [PATCH] Fix depricated functions in ONNX and boost + type conversion for ConfigurePythonTest --- DetDescr/src/DetDescr/DetectorIDBindings.cxx | 2 ++ Framework/include/Framework/ConfigurePython.h | 2 +- Framework/test/ConfigurePythonTest.cxx | 2 +- Tools/src/Tools/ONNXRuntime.cxx | 8 ++++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DetDescr/src/DetDescr/DetectorIDBindings.cxx b/DetDescr/src/DetDescr/DetectorIDBindings.cxx index 370b58132..762e16b2a 100644 --- a/DetDescr/src/DetDescr/DetectorIDBindings.cxx +++ b/DetDescr/src/DetDescr/DetectorIDBindings.cxx @@ -1,4 +1,6 @@ #if DETECTORID_BINDINGS_ENABLED +// This we may be able to remove after boost update +#define BOOST_BIND_GLOBAL_PLACEHOLDERS #include #include "DetDescr/DetectorID.h" diff --git a/Framework/include/Framework/ConfigurePython.h b/Framework/include/Framework/ConfigurePython.h index 3512fb446..7ee68c784 100644 --- a/Framework/include/Framework/ConfigurePython.h +++ b/Framework/include/Framework/ConfigurePython.h @@ -54,7 +54,7 @@ class ConfigurePython { * * Does nothing at the moment. */ - ~ConfigurePython() {} + ~ConfigurePython() = default; /** * Create a process object based on the python file information diff --git a/Framework/test/ConfigurePythonTest.cxx b/Framework/test/ConfigurePythonTest.cxx index 2a6b2125d..393240aee 100644 --- a/Framework/test/ConfigurePythonTest.cxx +++ b/Framework/test/ConfigurePythonTest.cxx @@ -163,7 +163,7 @@ TEST_CASE("Configure Python Test", "[Framework][functionality]") { // was set correctly. auto correct_log_freq{9000}; SECTION("Single argument to python script") { - args[0] = "9000"; + args[0] = (char *)"9000"; framework::ConfigurePython cfg(config_file_name_arg, args, 1); p = cfg.makeProcess(); diff --git a/Tools/src/Tools/ONNXRuntime.cxx b/Tools/src/Tools/ONNXRuntime.cxx index 991e363a1..9d9f6a1cb 100644 --- a/Tools/src/Tools/ONNXRuntime.cxx +++ b/Tools/src/Tools/ONNXRuntime.cxx @@ -72,7 +72,9 @@ ONNXRuntime::ONNXRuntime(const std::string& model_path, auto tensor_info = type_info.GetTensorTypeAndShapeInfo(); size_t num_dims = tensor_info.GetDimensionsCount(); input_node_dims_[input_name].resize(num_dims); - tensor_info.GetDimensions(input_node_dims_[input_name].data(), num_dims); + const auto input_shape = tensor_info.GetShape(); + std::copy(input_shape.begin(), input_shape.end(), + input_node_dims_[input_name].begin()); // set the batch size to 1 by default input_node_dims_[input_name].at(0) = 1; @@ -94,7 +96,9 @@ ONNXRuntime::ONNXRuntime(const std::string& model_path, auto tensor_info = type_info.GetTensorTypeAndShapeInfo(); size_t num_dims = tensor_info.GetDimensionsCount(); output_node_dims_[output_name].resize(num_dims); - tensor_info.GetDimensions(output_node_dims_[output_name].data(), num_dims); + const auto output_shape = tensor_info.GetShape(); + std::copy(output_shape.begin(), output_shape.end(), + output_node_dims_[output_name].begin()); // the 0th dim depends on the batch size output_node_dims_[output_name].at(0) = -1;