Relative Content

Tag Archive for c++functionreturnonnx

How do I return a vector such that I can access its values after the function call in C++?

I am trying to create an input tensor for a machine learning model using the ONNX Runtime. This is returned as a vector<Ort::Value>. After calling the function, the objects inside the vector are destroyed (I assume because the function scope ended and they get cleaned up).
My question doesn’t really concern the use of ONNX but is meant more generally on how to deal with more complex classes.