Can now load and run a network

- The library is now capable of loading the test session and running
   it successfully.

 - Updated the example application, which is really the same as the test
   and should probably be deleted.

 - TODO: The input names actually *do* need to match the names when the
   network was created. The hardcoded names in onnxruntime_wrapper.c
   will *not* do!
This commit is contained in:
yalue
2023-02-04 10:31:57 -05:00
parent ff910beb76
commit 137ec8f64f
5 changed files with 210 additions and 42 deletions

View File

@@ -48,6 +48,17 @@ OrtStatus *CreateSimpleSession(void *model_data, size_t model_data_length,
return status;
}
OrtStatus *RunSimpleSession(OrtSession *session, OrtValue *input,
OrtValue *output) {
// TODO (next): We actually *do* need to pass in these dang input names.
const char *input_name[] = {"1x4 Input Vector"};
const char *output_name[] = {"1x2 Output Vector"};
OrtStatus *status = NULL;
status = ort_api->Run(session, NULL, input_name,
(const OrtValue* const*) &input, 1, output_name, 1, &output);
return status;
}
void ReleaseOrtSession(OrtSession *session) {
ort_api->ReleaseSession(session);
}