Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated functions in ONNX and boost + type conversion for ConfigurePythonTest #1393

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DetDescr/src/DetDescr/DetectorIDBindings.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if DETECTORID_BINDINGS_ENABLED
// This we may be able to remove after boost update
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include <boost/python.hpp>
tvami marked this conversation as resolved.
Show resolved Hide resolved

#include "DetDescr/DetectorID.h"
Expand Down
2 changes: 1 addition & 1 deletion Framework/include/Framework/ConfigurePython.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ConfigurePython {
*
* Does nothing at the moment.
*/
~ConfigurePython() {}
~ConfigurePython() = default;

/**
* Create a process object based on the python file information
Expand Down
2 changes: 1 addition & 1 deletion Framework/test/ConfigurePythonTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 6 additions & 2 deletions Tools/src/Tools/ONNXRuntime.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Loading