23 for (
auto i = shape.
begin(); i != shape.
end() - 1; ++i) {
24 stream << *i <<
" x ";
26 stream << shape.
back();
36 auto allocator = Ort::AllocatorWithDefaultOptions();
39 m_session = Euclid::make_unique<Ort::Session>(
ORT_ENV, model_path.
c_str(), Ort::SessionOptions{nullptr});
42 throw Elements::Exception() <<
"Only ONNX models with a single output tensor are supported";
45 for (
int i=0; i<
m_session->GetInputCount(); i++) {
46 auto input_type =
m_session->GetInputTypeInfo(i);
57 auto output_type =
m_session->GetOutputTypeInfo(0);
59 m_output_shape = output_type.GetTensorTypeAndShapeInfo().GetShape();
60 m_output_type = output_type.GetTensorTypeAndShapeInfo().GetElementType();
static Logging getLogger(const std::string &name="")
void info(const std::string &logMessage)
T emplace_back(T... args)