microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
test/shared_test/test_kernel.hpp
26lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <math.h> |
| 7 | |
| 8 | const char* GetLibraryPath(); |
| 9 | |
| 10 | struct TestValue { |
| 11 | const char* name = nullptr; |
| 12 | ONNXTensorElementDataType element_type; |
| 13 | std::vector<int64_t> dims; |
| 14 | std::vector<float> values_float; |
| 15 | std::vector<int32_t> values_int32; |
| 16 | std::vector<std::string> values_string; |
| 17 | }; |
| 18 | |
| 19 | void RunSession(Ort::Session& session_object, |
| 20 | const std::vector<TestValue>& inputs, |
| 21 | const std::vector<TestValue>& outputs); |
| 22 | |
| 23 | void TestInference(Ort::Env& env, const ORTCHAR_T* model_uri, |
| 24 | const std::vector<TestValue>& inputs, |
| 25 | const std::vector<TestValue>& outputs, |
| 26 | const char* custom_op_library_filename); |
| 27 | |