mirror of
https://github.com/yalue/onnxruntime_go.git
synced 2025-11-01 19:22:39 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user