Skip to content

Removing some hardcoded parameter with meaningful variables

The onnxruntime example in athena/master has some hardcoded parameters (CxxApiAlgorithm.cxx)

 // create input tensor object from data values
     auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
     Ort::Value input_tensor = Ort::Value::CreateTensor<float>(memory_info, input_tensor_values.data(), input_tensor_size, input_node_dims.data(), 3);
     ...
     // score model & input tensor, get back output tensor
     auto output_tensors = m_session->Run(Ort::RunOptions{nullptr}, input_node_names.data(), &input_tensor, 1, output_node_names.data(), 1);

This MR replaces them with right variables e.g. input_node_dims.size(), input_node_names.size(), and output_node_names.size(). Adding @afarbin , @dguest and @mfenton

Merge request reports