#include #include "onnxruntime_cxx_api.h" int main() { try { Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test"); Ort::SessionOptions opts; opts.SetIntraOpNumThreads(1); std::cout << "Attempting to load model..." << std::endl; Ort::Session session(env, "mnist-8.onnx", opts); std::cout << "Model loaded successfully." << std::endl; Ort::AllocatorWithDefaultOptions alloc; auto input_name = session.GetInputNameAllocated(0, alloc); auto output_name = session.GetOutputNameAllocated(0, alloc); std::cout << "Input name: " << input_name.get() << std::endl; std::cout << "Output name: " << output_name.get() << std::endl; auto type_info = session.GetInputTypeInfo(0); auto tensor_info = type_info.GetTensorTypeAndShapeInfo(); auto shape = tensor_info.GetShape(); std::cout << "Input shape: "; for (auto d : shape) std::cout << d << " "; std::cout << std::endl; std::cout << "Test passed (no inference)." << std::endl; return 0; } catch (const Ort::Exception& e) { std::cerr << "ORT Error: " << e.what() << std::endl; return 1; } catch (const std::exception& e) { std::cerr << "Std exception: " << e.what() << std::endl; return 2; } }