com.github.asus4.onnxruntime 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Plugins/Android/{onnxruntime-android.aar → onnxruntime.aar} +0 -0
- package/Plugins/Linux/x64/libonnxruntime.so +0 -0
- package/Plugins/Linux/x64/libonnxruntime.so.meta +17 -37
- package/Plugins/Windows/arm64/onnxruntime.dll +0 -0
- package/Plugins/Windows/arm64/onnxruntime.dll.meta +65 -0
- package/{Editor.meta → Plugins/Windows/arm64.meta} +1 -1
- package/Plugins/Windows/x64/onnxruntime.dll +0 -0
- package/Plugins/Windows/x64/onnxruntime.dll.meta +15 -35
- package/Plugins/Windows/x86/onnxruntime.dll +0 -0
- package/Plugins/Windows/x86/onnxruntime.dll.meta +65 -0
- package/{Editor/com.github.asus4.onnxruntime.Editor.asmdef.meta → Plugins/Windows/x86.meta} +3 -2
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/Info.plist +9 -7
- package/Plugins/iOS/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/coreml_provider_factory.h +90 -0
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_c_api.h +41 -6
- package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator → iOS/onnxruntime.xcframework/ios-arm64}/onnxruntime.framework/Headers/onnxruntime_cxx_api.h +35 -6
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64/onnxruntime.framework}/Headers/onnxruntime_cxx_inline.h +2 -2
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64/onnxruntime.framework}/Headers/onnxruntime_session_options_config_keys.h +53 -2
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Info.plist +2 -2
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/onnxruntime +0 -0
- package/Plugins/iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Headers/coreml_provider_factory.h +90 -0
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64 → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst}/onnxruntime.framework/Versions/A/Headers/onnxruntime_c_api.h +41 -6
- package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_cxx_api.h +35 -6
- package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_cxx_inline.h +2 -2
- package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_session_options_config_keys.h +53 -2
- package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A/Resources}/Info.plist +2 -2
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64 → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst}/onnxruntime.framework/Versions/A/onnxruntime +0 -0
- package/Plugins/iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/coreml_provider_factory.h +90 -0
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_c_api.h +41 -6
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Headers/onnxruntime_cxx_api.h +35 -6
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_cxx_inline.h +2 -2
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/onnxruntime_session_options_config_keys.h +53 -2
- package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A/Resources → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Info.plist +2 -2
- package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/onnxruntime +0 -0
- package/Plugins/iOS/onnxruntime.xcframework.meta +61 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins/macOS/arm64/libonnxruntime.dylib +0 -0
- package/Plugins/macOS/{libonnxruntime.dylib.meta → arm64/libonnxruntime.dylib.meta} +20 -40
- package/Plugins/macOS/arm64.meta +8 -0
- package/Plugins/macOS/{libonnxruntime.dylib → x64/libonnxruntime.dylib} +0 -0
- package/Plugins/macOS/x64/libonnxruntime.dylib.meta +61 -0
- package/Plugins/macOS/x64.meta +8 -0
- package/README.md +9 -10
- package/Runtime/NativeMethods.shared.cs +1 -4
- package/Runtime/OrtValue.shared.cs +157 -1
- package/Runtime/SessionOptions.shared.cs +1 -42
- package/Runtime/Training/NativeTrainingMethods.shared.cs +1 -1
- package/package.json +1 -1
- package/Editor/OrtPostProcessBuild.cs +0 -77
- package/Editor/OrtPostProcessBuild.cs.meta +0 -11
- package/Editor/com.github.asus4.onnxruntime.Editor.asmdef +0 -16
- package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/coreml_provider_factory.h +0 -53
- package/Plugins/iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework/Headers/coreml_provider_factory.h +0 -53
- package/Plugins/iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A/Headers/coreml_provider_factory.h +0 -53
- /package/Plugins/Android/{onnxruntime-android.aar.meta → onnxruntime.aar.meta} +0 -0
- /package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/cpu_provider_factory.h +0 -0
- /package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_float16.h +0 -0
- /package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_lite_custom_op.h +0 -0
- /package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Headers/onnxruntime_run_options_config_keys.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/cpu_provider_factory.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_float16.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_lite_custom_op.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework → iOS/onnxruntime.xcframework/ios-arm64_x86_64-maccatalyst/onnxruntime.framework/Versions/A}/Headers/onnxruntime_run_options_config_keys.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Headers/cpu_provider_factory.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Headers/onnxruntime_float16.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Headers/onnxruntime_lite_custom_op.h +0 -0
- /package/Plugins/{iOS~/onnxruntime.xcframework/macos-arm64_x86_64/onnxruntime.framework/Versions/A → iOS/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.framework}/Headers/onnxruntime_run_options_config_keys.h +0 -0
|
@@ -650,6 +650,9 @@ using AllocatedStringPtr = std::unique_ptr<char, detail::AllocatedFree>;
|
|
|
650
650
|
* constructors to construct an instance of a Status object from exceptions.
|
|
651
651
|
*/
|
|
652
652
|
struct Status : detail::Base<OrtStatus> {
|
|
653
|
+
using Base = detail::Base<OrtStatus>;
|
|
654
|
+
using Base::Base;
|
|
655
|
+
|
|
653
656
|
explicit Status(std::nullptr_t) noexcept {} ///< Create an empty object, must be assigned a valid one to be used
|
|
654
657
|
explicit Status(OrtStatus* status) noexcept; ///< Takes ownership of OrtStatus instance returned from the C API.
|
|
655
658
|
explicit Status(const Exception&) noexcept; ///< Creates status instance out of exception
|
|
@@ -728,6 +731,9 @@ struct Env : detail::Base<OrtEnv> {
|
|
|
728
731
|
*
|
|
729
732
|
*/
|
|
730
733
|
struct CustomOpDomain : detail::Base<OrtCustomOpDomain> {
|
|
734
|
+
using Base = detail::Base<OrtCustomOpDomain>;
|
|
735
|
+
using Base::Base;
|
|
736
|
+
|
|
731
737
|
explicit CustomOpDomain(std::nullptr_t) {} ///< Create an empty CustomOpDomain object, must be assigned a valid one to be used
|
|
732
738
|
|
|
733
739
|
/// \brief Wraps OrtApi::CreateCustomOpDomain
|
|
@@ -963,8 +969,10 @@ struct SessionOptions : detail::SessionOptionsImpl<OrtSessionOptions> {
|
|
|
963
969
|
*
|
|
964
970
|
*/
|
|
965
971
|
struct ModelMetadata : detail::Base<OrtModelMetadata> {
|
|
966
|
-
|
|
967
|
-
|
|
972
|
+
using Base = detail::Base<OrtModelMetadata>;
|
|
973
|
+
using Base::Base;
|
|
974
|
+
|
|
975
|
+
explicit ModelMetadata(std::nullptr_t) {} ///< Create an empty ModelMetadata object, must be assigned a valid one to be used
|
|
968
976
|
|
|
969
977
|
/** \brief Returns a copy of the producer name.
|
|
970
978
|
*
|
|
@@ -1237,6 +1245,9 @@ using ConstTensorTypeAndShapeInfo = detail::TensorTypeAndShapeInfoImpl<detail::U
|
|
|
1237
1245
|
*
|
|
1238
1246
|
*/
|
|
1239
1247
|
struct TensorTypeAndShapeInfo : detail::TensorTypeAndShapeInfoImpl<OrtTensorTypeAndShapeInfo> {
|
|
1248
|
+
using Base = detail::TensorTypeAndShapeInfoImpl<OrtTensorTypeAndShapeInfo>;
|
|
1249
|
+
using Base::Base;
|
|
1250
|
+
|
|
1240
1251
|
explicit TensorTypeAndShapeInfo(std::nullptr_t) {} ///< Create an empty TensorTypeAndShapeInfo object, must be assigned a valid one to be used
|
|
1241
1252
|
explicit TensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo* p) : TensorTypeAndShapeInfoImpl{p} {} ///< Used for interop with the C API
|
|
1242
1253
|
ConstTensorTypeAndShapeInfo GetConst() const { return ConstTensorTypeAndShapeInfo{this->p_}; }
|
|
@@ -1258,6 +1269,9 @@ using ConstSequenceTypeInfo = detail::SequenceTypeInfoImpl<detail::Unowned<const
|
|
|
1258
1269
|
*
|
|
1259
1270
|
*/
|
|
1260
1271
|
struct SequenceTypeInfo : detail::SequenceTypeInfoImpl<OrtSequenceTypeInfo> {
|
|
1272
|
+
using Base = detail::SequenceTypeInfoImpl<OrtSequenceTypeInfo>;
|
|
1273
|
+
using Base::Base;
|
|
1274
|
+
|
|
1261
1275
|
explicit SequenceTypeInfo(std::nullptr_t) {} ///< Create an empty SequenceTypeInfo object, must be assigned a valid one to be used
|
|
1262
1276
|
explicit SequenceTypeInfo(OrtSequenceTypeInfo* p) : SequenceTypeInfoImpl<OrtSequenceTypeInfo>{p} {} ///< Used for interop with the C API
|
|
1263
1277
|
ConstSequenceTypeInfo GetConst() const { return ConstSequenceTypeInfo{this->p_}; }
|
|
@@ -1293,6 +1307,9 @@ using ConstMapTypeInfo = detail::MapTypeInfoImpl<detail::Unowned<const OrtMapTyp
|
|
|
1293
1307
|
*
|
|
1294
1308
|
*/
|
|
1295
1309
|
struct MapTypeInfo : detail::MapTypeInfoImpl<OrtMapTypeInfo> {
|
|
1310
|
+
using Base = detail::MapTypeInfoImpl<OrtMapTypeInfo>;
|
|
1311
|
+
using Base::Base;
|
|
1312
|
+
|
|
1296
1313
|
explicit MapTypeInfo(std::nullptr_t) {} ///< Create an empty MapTypeInfo object, must be assigned a valid one to be used
|
|
1297
1314
|
explicit MapTypeInfo(OrtMapTypeInfo* p) : MapTypeInfoImpl<OrtMapTypeInfo>{p} {} ///< Used for interop with the C API
|
|
1298
1315
|
ConstMapTypeInfo GetConst() const { return ConstMapTypeInfo{this->p_}; }
|
|
@@ -1324,6 +1341,9 @@ using ConstTypeInfo = detail::TypeInfoImpl<detail::Unowned<const OrtTypeInfo>>;
|
|
|
1324
1341
|
/// the information about contained sequence or map depending on the ONNXType.
|
|
1325
1342
|
/// </summary>
|
|
1326
1343
|
struct TypeInfo : detail::TypeInfoImpl<OrtTypeInfo> {
|
|
1344
|
+
using Base = detail::TypeInfoImpl<OrtTypeInfo>;
|
|
1345
|
+
using Base::Base;
|
|
1346
|
+
|
|
1327
1347
|
explicit TypeInfo(std::nullptr_t) {} ///< Create an empty TypeInfo object, must be assigned a valid one to be used
|
|
1328
1348
|
explicit TypeInfo(OrtTypeInfo* p) : TypeInfoImpl<OrtTypeInfo>{p} {} ///< C API Interop
|
|
1329
1349
|
|
|
@@ -1661,11 +1681,11 @@ using UnownedValue = detail::ValueImpl<detail::Unowned<OrtValue>>;
|
|
|
1661
1681
|
*/
|
|
1662
1682
|
struct Value : detail::ValueImpl<OrtValue> {
|
|
1663
1683
|
using Base = detail::ValueImpl<OrtValue>;
|
|
1684
|
+
using Base::Base;
|
|
1664
1685
|
using OrtSparseValuesParam = detail::OrtSparseValuesParam;
|
|
1665
1686
|
using Shape = detail::Shape;
|
|
1666
1687
|
|
|
1667
|
-
explicit Value(std::nullptr_t) {}
|
|
1668
|
-
explicit Value(OrtValue* p) : Base{p} {} ///< Used for interop with the C API
|
|
1688
|
+
explicit Value(std::nullptr_t) {} ///< Create an empty Value object, must be assigned a valid one to be used
|
|
1669
1689
|
Value(Value&&) = default;
|
|
1670
1690
|
Value& operator=(Value&&) = default;
|
|
1671
1691
|
|
|
@@ -1941,6 +1961,10 @@ struct ArenaCfg : detail::Base<OrtArenaCfg> {
|
|
|
1941
1961
|
/// This struct provides life time management for custom op attribute
|
|
1942
1962
|
/// </summary>
|
|
1943
1963
|
struct OpAttr : detail::Base<OrtOpAttr> {
|
|
1964
|
+
using Base = detail::Base<OrtOpAttr>;
|
|
1965
|
+
using Base::Base;
|
|
1966
|
+
|
|
1967
|
+
explicit OpAttr(std::nullptr_t) {}
|
|
1944
1968
|
OpAttr(const char* name, const void* data, int len, OrtOpAttrType type);
|
|
1945
1969
|
};
|
|
1946
1970
|
|
|
@@ -2106,10 +2130,10 @@ struct KernelContext {
|
|
|
2106
2130
|
explicit KernelContext(OrtKernelContext* context);
|
|
2107
2131
|
size_t GetInputCount() const;
|
|
2108
2132
|
size_t GetOutputCount() const;
|
|
2109
|
-
// If input is optional and is not present, the method returns
|
|
2133
|
+
// If input is optional and is not present, the method returns an empty ConstValue
|
|
2110
2134
|
// which can be compared to nullptr.
|
|
2111
2135
|
ConstValue GetInput(size_t index) const;
|
|
2112
|
-
// If
|
|
2136
|
+
// If output is optional and is not present, the method returns an empty UnownedValue
|
|
2113
2137
|
// which can be compared to nullptr.
|
|
2114
2138
|
UnownedValue GetOutput(size_t index, const int64_t* dim_values, size_t dim_count) const;
|
|
2115
2139
|
UnownedValue GetOutput(size_t index, const std::vector<int64_t>& dims) const;
|
|
@@ -2183,6 +2207,8 @@ using ConstKernelInfo = detail::KernelInfoImpl<detail::Unowned<const OrtKernelIn
|
|
|
2183
2207
|
/// so it does not destroy the pointer the kernel does not own.
|
|
2184
2208
|
/// </summary>
|
|
2185
2209
|
struct KernelInfo : detail::KernelInfoImpl<OrtKernelInfo> {
|
|
2210
|
+
using Base = detail::KernelInfoImpl<OrtKernelInfo>;
|
|
2211
|
+
using Base::Base;
|
|
2186
2212
|
explicit KernelInfo(std::nullptr_t) {} ///< Create an empty instance to initialize later
|
|
2187
2213
|
explicit KernelInfo(OrtKernelInfo* info); ///< Take ownership of the instance
|
|
2188
2214
|
ConstKernelInfo GetConst() const { return ConstKernelInfo{this->p_}; }
|
|
@@ -2192,6 +2218,9 @@ struct KernelInfo : detail::KernelInfoImpl<OrtKernelInfo> {
|
|
|
2192
2218
|
/// Create and own custom defined operation.
|
|
2193
2219
|
/// </summary>
|
|
2194
2220
|
struct Op : detail::Base<OrtOp> {
|
|
2221
|
+
using Base = detail::Base<OrtOp>;
|
|
2222
|
+
using Base::Base;
|
|
2223
|
+
|
|
2195
2224
|
explicit Op(std::nullptr_t) {} ///< Create an empty Operator object, must be assigned a valid one to be used
|
|
2196
2225
|
|
|
2197
2226
|
explicit Op(OrtOp*); ///< Take ownership of the OrtOp
|
|
@@ -51,7 +51,7 @@ inline void ThrowOnError(const Status& st) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
inline Status::Status(OrtStatus* status) noexcept : Base<OrtStatus>{status} {
|
|
54
|
+
inline Status::Status(OrtStatus* status) noexcept : detail::Base<OrtStatus>{status} {
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
inline Status::Status(const std::exception& e) noexcept {
|
|
@@ -1908,7 +1908,7 @@ inline void attr_utils::GetAttrs(const OrtKernelInfo* p, const char* name, std::
|
|
|
1908
1908
|
|
|
1909
1909
|
inline KernelInfo::KernelInfo(OrtKernelInfo* info) : detail::KernelInfoImpl<OrtKernelInfo>{info} {}
|
|
1910
1910
|
|
|
1911
|
-
inline Op::Op(OrtOp* p) : Base<OrtOp>(p) {}
|
|
1911
|
+
inline Op::Op(OrtOp* p) : detail::Base<OrtOp>(p) {}
|
|
1912
1912
|
|
|
1913
1913
|
inline Op Op::Create(const OrtKernelInfo* info, const char* op_name, const char* domain, int version,
|
|
1914
1914
|
const char** type_constraint_names,
|
|
@@ -250,6 +250,51 @@ static const char* const kOrtSessionOptionsOptimizedModelExternalInitializersFil
|
|
|
250
250
|
static const char* const kOrtSessionOptionsOptimizedModelExternalInitializersMinSizeInBytes =
|
|
251
251
|
"session.optimized_model_external_initializers_min_size_in_bytes";
|
|
252
252
|
|
|
253
|
+
// When loading model from memory buffer and the model has external initializers
|
|
254
|
+
// Use this config to set the external data file folder path
|
|
255
|
+
// All external data files should be in the same folder
|
|
256
|
+
static const char* const kOrtSessionOptionsModelExternalInitializersFileFolderPath =
|
|
257
|
+
"session.model_external_initializers_file_folder_path";
|
|
258
|
+
|
|
259
|
+
// Use this config when saving pre-packed constant initializers to an external data file.
|
|
260
|
+
// This allows you to memory map pre-packed initializers on model load and leave it to
|
|
261
|
+
// to the OS the amount of memory consumed by the pre-packed initializers. Otherwise,
|
|
262
|
+
// pre-packed data resides on the heap.
|
|
263
|
+
//
|
|
264
|
+
// - "0": Default is not save pre-packed initializers to a data file.
|
|
265
|
+
// - "1": Save pre-packed constant initializers to an external data file.
|
|
266
|
+
// Sample usage: sess_options.add_session_config_entry(kOrtSessionOptionsSavePrePackedConstantInitializers, "1")
|
|
267
|
+
static const char* const kOrtSessionOptionsSavePrePackedConstantInitializers =
|
|
268
|
+
"session.save_external_prepacked_constant_initializers";
|
|
269
|
+
|
|
270
|
+
// Use this config when you want to collect memory stats for each node in the graph.
|
|
271
|
+
// The file format is a CSV file with the following columns:
|
|
272
|
+
// The file will be created if it does not exist, and will be overwritten if it does.
|
|
273
|
+
//
|
|
274
|
+
// The content of the file can be used to estimate memory requirements at run time including
|
|
275
|
+
// the temporary allocations. This operation is preferably done on a CPU device, as the model may exceed
|
|
276
|
+
// device memory limits in constrained environments. When enabling this option, it is important to disable
|
|
277
|
+
// memory patterns, as they tend to allocate large blocks to avoid fragmentation and accommodate needs of multiple
|
|
278
|
+
// kernels. Memory patterns may make it difficult to allocate on a device with limited memory.
|
|
279
|
+
//
|
|
280
|
+
// The collected stats then can be used to partition the graph among the devices in a way that only the
|
|
281
|
+
// required memory is allocated on each device.
|
|
282
|
+
//
|
|
283
|
+
// node_name, initializers_memory, dynamic_outputs_sizes, temp_allocations_size
|
|
284
|
+
//
|
|
285
|
+
// - "full path to file": there is not a default for this option. If the file can not be opened for writing, an error will be returned.
|
|
286
|
+
static const char* const kOrtSessionOptionsCollectNodeMemoryStatsToFile = "session.collect_node_memory_stats_to_file";
|
|
287
|
+
|
|
288
|
+
/// This is a composite CSV setting formatted as "memory limit in kb,file name for collected stats"
|
|
289
|
+
/// "limit > 0": enables Capacity Aware Partitioning for Cuda EP. `limit` is optional and when absent
|
|
290
|
+
/// the provider may attempt to figure out the memory available automatically.
|
|
291
|
+
/// The setting with no limit is expected to look like: ",file name for collected stats"
|
|
292
|
+
/// The EP will place nodes on device "file name" :
|
|
293
|
+
/// this file is expected to be found at the same folder with the model. The file contains
|
|
294
|
+
/// pre-recorded stats collected when running with kOrtSessionOptionsCollectNodeMemoryStatsToFile enforce (see above)
|
|
295
|
+
static const char* const kOrtSessionOptionsResourceCudaPartitioningSettings =
|
|
296
|
+
"session.resource_cuda_partitioning_settings";
|
|
297
|
+
|
|
253
298
|
// Enable EP context feature to dump the partitioned graph which includes the EP context into Onnx file.
|
|
254
299
|
// The dumped Onnx model with EP context can be used for future inference to avoid the EP graph partitioning/compile overhead.
|
|
255
300
|
// "0": disable. (default)
|
|
@@ -258,11 +303,12 @@ static const char* const kOrtSessionOptionEpContextEnable = "ep.context_enable";
|
|
|
258
303
|
|
|
259
304
|
// Specify the file path for the Onnx model which has EP context.
|
|
260
305
|
// Default to original_file_name_ctx.onnx if not specified
|
|
306
|
+
// Folder is not a valid option
|
|
261
307
|
static const char* const kOrtSessionOptionEpContextFilePath = "ep.context_file_path";
|
|
262
308
|
|
|
263
309
|
// Flag to specify whether to dump the EP context into the Onnx model.
|
|
264
|
-
// "0": dump the EP context into separate file, keep the file name in the Onnx model.
|
|
265
|
-
// "1": dump the EP context into the Onnx model.
|
|
310
|
+
// "0": dump the EP context into separate file, keep the file name in the Onnx model. (default).
|
|
311
|
+
// "1": dump the EP context into the Onnx model.
|
|
266
312
|
static const char* const kOrtSessionOptionEpContextEmbedMode = "ep.context_embed_mode";
|
|
267
313
|
|
|
268
314
|
// Specify the EPContext node name prefix to make it unique
|
|
@@ -272,6 +318,11 @@ static const char* const kOrtSessionOptionEpContextNodeNamePrefix = "ep.context_
|
|
|
272
318
|
// Share EP related resources across EPs
|
|
273
319
|
static const char* const kOrtSessionOptionShareEpContexts = "ep.share_ep_contexts";
|
|
274
320
|
|
|
321
|
+
// Use this config when dumping EP context model with an external initializers file
|
|
322
|
+
// All initializers will be inside the external data file if specified, otherwise all in Onnx file
|
|
323
|
+
static const char* const kOrtSessionOptionsEpContextModelExternalInitializersFileName =
|
|
324
|
+
"ep.context_model_external_initializers_file_name";
|
|
325
|
+
|
|
275
326
|
// Gemm fastmath mode provides fp32 gemm acceleration with bfloat16 based matmul.
|
|
276
327
|
// Option values:
|
|
277
328
|
// - "0": Gemm FastMath mode is not enabled. [DEFAULT]
|
package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/Info.plist
RENAMED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<key>CFBundleIdentifier</key>
|
|
10
10
|
<string>com.microsoft.onnxruntime</string>
|
|
11
11
|
<key>CFBundleVersion</key>
|
|
12
|
-
<string>1.
|
|
12
|
+
<string>1.21.0</string>
|
|
13
13
|
<key>CFBundleShortVersionString</key>
|
|
14
|
-
<string>1.
|
|
14
|
+
<string>1.21.0</string>
|
|
15
15
|
<key>CFBundleSignature</key>
|
|
16
16
|
<string>????</string>
|
|
17
17
|
<key>CFBundlePackageType</key>
|
package/Plugins/{iOS~ → iOS}/onnxruntime.xcframework/ios-arm64/onnxruntime.framework/onnxruntime
RENAMED
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#pragma once
|
|
4
|
+
|
|
5
|
+
#include "onnxruntime_c_api.h"
|
|
6
|
+
|
|
7
|
+
// COREMLFlags are bool options we want to set for CoreML EP
|
|
8
|
+
// This enum is defined as bit flags, and cannot have negative value
|
|
9
|
+
// To generate an uint32_t coreml_flags for using with OrtSessionOptionsAppendExecutionProvider_CoreML below,
|
|
10
|
+
// uint32_t coreml_flags = 0;
|
|
11
|
+
// coreml_flags |= COREML_FLAG_USE_CPU_ONLY;
|
|
12
|
+
enum COREMLFlags {
|
|
13
|
+
COREML_FLAG_USE_NONE = 0x000,
|
|
14
|
+
|
|
15
|
+
// Using CPU only in CoreML EP, this may decrease the perf but will provide
|
|
16
|
+
// reference output value without precision loss, which is useful for validation
|
|
17
|
+
COREML_FLAG_USE_CPU_ONLY = 0x001,
|
|
18
|
+
|
|
19
|
+
// Enable CoreML EP on subgraph
|
|
20
|
+
COREML_FLAG_ENABLE_ON_SUBGRAPH = 0x002,
|
|
21
|
+
|
|
22
|
+
// By default CoreML Execution provider will be enabled for all compatible Apple devices
|
|
23
|
+
// Enable this option will only enable CoreML EP for Apple devices with ANE (Apple Neural Engine)
|
|
24
|
+
// Please note, enable this option does not guarantee the entire model to be executed using ANE only
|
|
25
|
+
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE = 0x004,
|
|
26
|
+
|
|
27
|
+
// Only allow CoreML EP to take nodes with inputs with static shapes. By default it will also allow inputs with
|
|
28
|
+
// dynamic shapes. However, the performance may be negatively impacted if inputs have dynamic shapes.
|
|
29
|
+
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008,
|
|
30
|
+
|
|
31
|
+
// Create an MLProgram. By default it will create a NeuralNetwork model. Requires Core ML 5 or later.
|
|
32
|
+
COREML_FLAG_CREATE_MLPROGRAM = 0x010,
|
|
33
|
+
|
|
34
|
+
// https://developer.apple.com/documentation/coreml/mlcomputeunits?language=objc
|
|
35
|
+
// there are four compute units:
|
|
36
|
+
// MLComputeUnitsCPUAndNeuralEngine|MLComputeUnitsCPUAndGPU|MLComputeUnitsCPUOnly|MLComputeUnitsAll
|
|
37
|
+
// different CU will have different performance and power consumption
|
|
38
|
+
COREML_FLAG_USE_CPU_AND_GPU = 0x020,
|
|
39
|
+
// Keep COREML_FLAG_LAST at the end of the enum definition
|
|
40
|
+
// And assign the last COREMLFlag to it
|
|
41
|
+
COREML_FLAG_LAST = COREML_FLAG_USE_CPU_AND_GPU,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// MLComputeUnits can be one of the following values:
|
|
45
|
+
// 'MLComputeUnitsCPUAndNeuralEngine|MLComputeUnitsCPUAndGPU|MLComputeUnitsCPUOnly|MLComputeUnitsAll'
|
|
46
|
+
// these values are intended to be used with Ort::SessionOptions::AppendExecutionProvider (C++ API)
|
|
47
|
+
// and SessionOptionsAppendExecutionProvider (C API). For the old API, use COREMLFlags instead.
|
|
48
|
+
static const char* const kCoremlProviderOption_MLComputeUnits = "MLComputeUnits";
|
|
49
|
+
static const char* const kCoremlProviderOption_ModelFormat = "ModelFormat";
|
|
50
|
+
// same as COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES
|
|
51
|
+
static const char* const kCoremlProviderOption_RequireStaticInputShapes = "RequireStaticInputShapes";
|
|
52
|
+
static const char* const kCoremlProviderOption_EnableOnSubgraphs = "EnableOnSubgraphs";
|
|
53
|
+
// provided by https://developer.apple.com/documentation/coreml/mloptimizationhints-swift.struct/specializationstrategy-swift.property
|
|
54
|
+
// Core ML segments the model’s compute graph and specializes each segment for the target compute device.
|
|
55
|
+
// This process can affect the model loading time and the prediction latency.
|
|
56
|
+
// Use this option to tailor the specialization strategy for your model.
|
|
57
|
+
static const char* const kCoremlProviderOption_SpecializationStrategy = "SpecializationStrategy";
|
|
58
|
+
// Profile the Core ML MLComputePlan.
|
|
59
|
+
// This logs the hardware each operator is dispatched to and the estimated execution time.
|
|
60
|
+
// Intended for developer usage but provide useful diagnostic information if performance is not as expected.
|
|
61
|
+
static const char* const kCoremlProviderOption_ProfileComputePlan = "ProfileComputePlan";
|
|
62
|
+
// please refer to https://developer.apple.com/documentation/coreml/mlmodelconfiguration/allowlowprecisionaccumulationongpu
|
|
63
|
+
static const char* const kCoremlProviderOption_AllowLowPrecisionAccumulationOnGPU = "AllowLowPrecisionAccumulationOnGPU";
|
|
64
|
+
// Specify the directory to cache any CoreML models created from the ONNX model in.
|
|
65
|
+
// CoreML EP will convert onnx subgraph to CoreML model and save to disk.
|
|
66
|
+
// If this path is not specified, the model will be saved to a temp directory and deleted after the session is closed.
|
|
67
|
+
// otherwise, the model will be saved to the specified path and User should manage to delete the model.
|
|
68
|
+
|
|
69
|
+
// we do NOT detect if the onnx model has changed and no longer matches the cached model.
|
|
70
|
+
// the user should carefully manage the cache if modifying/replacing a model.
|
|
71
|
+
// The cache key is generated by
|
|
72
|
+
// 1. User provided key in metadata_props if found (preferred)
|
|
73
|
+
// 2. Hash of the model url the inference session was created with
|
|
74
|
+
// 3. Hash of the input/output names of the model
|
|
75
|
+
// Please find out how to set metadata_props in the onnxruntime API documentation. https://onnxruntime.ai/docs/execution-providers/CoreML-ExecutionProvider.html#configuration-options
|
|
76
|
+
static const char* const kCoremlProviderOption_ModelCacheDirectory = "ModelCacheDirectory";
|
|
77
|
+
|
|
78
|
+
// User provided cache-key in metadata_props.
|
|
79
|
+
static const char* const kCOREML_CACHE_KEY = "COREML_CACHE_KEY";
|
|
80
|
+
|
|
81
|
+
#ifdef __cplusplus
|
|
82
|
+
extern "C" {
|
|
83
|
+
#endif
|
|
84
|
+
|
|
85
|
+
ORT_EXPORT ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CoreML,
|
|
86
|
+
_In_ OrtSessionOptions* options, uint32_t coreml_flags);
|
|
87
|
+
|
|
88
|
+
#ifdef __cplusplus
|
|
89
|
+
}
|
|
90
|
+
#endif
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
*
|
|
39
39
|
* This value is used by some API functions to behave as this version of the header expects.
|
|
40
40
|
*/
|
|
41
|
-
#define ORT_API_VERSION
|
|
41
|
+
#define ORT_API_VERSION 21
|
|
42
42
|
|
|
43
43
|
#ifdef __cplusplus
|
|
44
44
|
extern "C" {
|
|
@@ -46,7 +46,7 @@ extern "C" {
|
|
|
46
46
|
|
|
47
47
|
//! @}
|
|
48
48
|
// SAL2 Definitions
|
|
49
|
-
#ifndef
|
|
49
|
+
#ifndef _MSC_VER
|
|
50
50
|
#define _In_
|
|
51
51
|
#define _In_z_
|
|
52
52
|
#define _In_opt_
|
|
@@ -626,8 +626,13 @@ typedef struct OrtMIGraphXProviderOptions {
|
|
|
626
626
|
} OrtMIGraphXProviderOptions;
|
|
627
627
|
|
|
628
628
|
/** \brief OpenVINO Provider Options
|
|
629
|
-
*
|
|
630
|
-
*
|
|
629
|
+
* \brief This Struct is frozen since ORT 1.13.0. Its maintained part of Legacy API for compatibility.
|
|
630
|
+
* \brief For latest OpenVINO Provider Options update to the ProviderOptions map.
|
|
631
|
+
* \brief Latest OpenVINO Provider Options are listed in the
|
|
632
|
+
* \htmlonly
|
|
633
|
+
* <a href="https://onnxruntime.ai/docs/execution-providers/OpenVINO-ExecutionProvider.html#summary-of-options">onnxruntime document.</a>
|
|
634
|
+
* \endhtmlonly
|
|
635
|
+
* \see OrtApi::SessionOptionsAppendExecutionProvider()
|
|
631
636
|
*/
|
|
632
637
|
typedef struct OrtOpenVINOProviderOptions {
|
|
633
638
|
#ifdef __cplusplus
|
|
@@ -645,7 +650,7 @@ typedef struct OrtOpenVINOProviderOptions {
|
|
|
645
650
|
* Valid settings are one of: "CPU_FP32", "CPU_FP16", "GPU_FP32", "GPU_FP16"
|
|
646
651
|
*/
|
|
647
652
|
const char* device_type;
|
|
648
|
-
unsigned char enable_npu_fast_compile;
|
|
653
|
+
unsigned char enable_npu_fast_compile; ///< 0 = disabled, nonzero = enabled
|
|
649
654
|
const char* device_id;
|
|
650
655
|
size_t num_of_threads; ///< 0 = Use default number of threads
|
|
651
656
|
const char* cache_dir; // path is set to empty by default
|
|
@@ -3660,8 +3665,19 @@ struct OrtApi {
|
|
|
3660
3665
|
* - "1": Enabled.
|
|
3661
3666
|
* "offload_graph_io_quantization": Offload graph input quantization and graph output dequantization to another
|
|
3662
3667
|
* execution provider (typically CPU EP).
|
|
3663
|
-
* - "0":
|
|
3668
|
+
* - "0": Disabled. QNN EP will handle quantization and dequantization of graph I/O.
|
|
3669
|
+
* - "1": Enabled. This is the default value.
|
|
3670
|
+
* "enable_htp_spill_fill_buffer": Enable HTP spill fill buffer setting. The flag is used while generating context binary.
|
|
3671
|
+
* - "0": Default. Disabled.
|
|
3672
|
+
* - "1": Enabled.
|
|
3673
|
+
* "enable_htp_shared_memory_allocator": Enable the QNN HTP shared memory allocator. Requires libcdsprpc.so/dll to
|
|
3674
|
+
* be available.
|
|
3675
|
+
* - "0": Default. Disabled.
|
|
3664
3676
|
* - "1": Enabled.
|
|
3677
|
+
* "dump_json_qnn_graph": Set to "1" to dump QNN graphs generated by QNN EP as JSON files. Each graph partition
|
|
3678
|
+
* assigned to QNN EP is dumped to a separate file.
|
|
3679
|
+
* "json_qnn_graph_dir": Directory in which to dump QNN JSON graphs. If not specified, QNN graphs are dumped in the
|
|
3680
|
+
* program's current working directory. Ignored if "dump_json_qnn_graph" is not set.
|
|
3665
3681
|
*
|
|
3666
3682
|
* SNPE supported keys:
|
|
3667
3683
|
* "runtime": SNPE runtime engine, options: "CPU", "CPU_FLOAT32", "GPU", "GPU_FLOAT32_16_HYBRID", "GPU_FLOAT16",
|
|
@@ -4607,6 +4623,8 @@ struct OrtApi {
|
|
|
4607
4623
|
* \param[in] num_keys
|
|
4608
4624
|
*
|
|
4609
4625
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4626
|
+
*
|
|
4627
|
+
* \since Version 1.17.
|
|
4610
4628
|
*/
|
|
4611
4629
|
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_OpenVINO_V2,
|
|
4612
4630
|
_In_ OrtSessionOptions* options,
|
|
@@ -4624,6 +4642,8 @@ struct OrtApi {
|
|
|
4624
4642
|
* \param[in] num_keys
|
|
4625
4643
|
*
|
|
4626
4644
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4645
|
+
*
|
|
4646
|
+
* \since Version 1.18.
|
|
4627
4647
|
*/
|
|
4628
4648
|
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_VitisAI,
|
|
4629
4649
|
_In_ OrtSessionOptions* options,
|
|
@@ -4637,7 +4657,10 @@ struct OrtApi {
|
|
|
4637
4657
|
* \param[in] mem_info OrtMemoryInfo instance
|
|
4638
4658
|
* \param[in] count_or_bytes How many bytes is this scratch buffer
|
|
4639
4659
|
* \param[out] out A pointer to the scrach buffer
|
|
4660
|
+
*
|
|
4640
4661
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4662
|
+
*
|
|
4663
|
+
* \since Version 1.18.
|
|
4641
4664
|
*/
|
|
4642
4665
|
ORT_API2_STATUS(KernelContext_GetScratchBuffer, _In_ const OrtKernelContext* context, _In_ const OrtMemoryInfo* mem_info, _In_ size_t count_or_bytes, _Outptr_ void** out);
|
|
4643
4666
|
|
|
@@ -4648,6 +4671,8 @@ struct OrtApi {
|
|
|
4648
4671
|
* \param[out] out A pointer to OrtAllocator
|
|
4649
4672
|
*
|
|
4650
4673
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4674
|
+
*
|
|
4675
|
+
* \since Version 1.18.
|
|
4651
4676
|
*/
|
|
4652
4677
|
ORT_API2_STATUS(KernelInfoGetAllocator, _In_ const OrtKernelInfo* info, _In_ OrtMemType mem_type, _Outptr_ OrtAllocator** out);
|
|
4653
4678
|
|
|
@@ -4669,6 +4694,8 @@ struct OrtApi {
|
|
|
4669
4694
|
* \param[in] num_external_initializer_files Number of external files
|
|
4670
4695
|
*
|
|
4671
4696
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4697
|
+
*
|
|
4698
|
+
* \since Version 1.18.
|
|
4672
4699
|
*/
|
|
4673
4700
|
ORT_API2_STATUS(AddExternalInitializersFromFilesInMemory, _In_ OrtSessionOptions* options,
|
|
4674
4701
|
_In_reads_(num_external_initializer_files) const ORTCHAR_T* const* external_initializer_file_names,
|
|
@@ -4691,6 +4718,8 @@ struct OrtApi {
|
|
|
4691
4718
|
* OrtApi::ReleaseLoraAdapter.
|
|
4692
4719
|
*
|
|
4693
4720
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4721
|
+
*
|
|
4722
|
+
* \since Version 1.20.
|
|
4694
4723
|
*/
|
|
4695
4724
|
ORT_API2_STATUS(CreateLoraAdapter, const ORTCHAR_T* adapter_file_path, _In_ OrtAllocator* allocator,
|
|
4696
4725
|
_Outptr_ OrtLoraAdapter** out);
|
|
@@ -4709,6 +4738,8 @@ struct OrtApi {
|
|
|
4709
4738
|
* OrtApi::ReleaseLoraAdapter.
|
|
4710
4739
|
*
|
|
4711
4740
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4741
|
+
*
|
|
4742
|
+
* \since Version 1.20.
|
|
4712
4743
|
*/
|
|
4713
4744
|
ORT_API2_STATUS(CreateLoraAdapterFromArray, _In_ const void* bytes, size_t num_bytes, _In_ OrtAllocator* allocator,
|
|
4714
4745
|
_Outptr_ OrtLoraAdapter** out);
|
|
@@ -4730,6 +4761,8 @@ struct OrtApi {
|
|
|
4730
4761
|
* \param[in] adapter OrtLoraAdapter instance
|
|
4731
4762
|
*
|
|
4732
4763
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4764
|
+
*
|
|
4765
|
+
* \since Version 1.20.
|
|
4733
4766
|
*/
|
|
4734
4767
|
ORT_API2_STATUS(RunOptionsAddActiveLoraAdapter, _Inout_ OrtRunOptions* options, _In_ const OrtLoraAdapter* adapter);
|
|
4735
4768
|
|
|
@@ -4748,6 +4781,8 @@ struct OrtApi {
|
|
|
4748
4781
|
* \param[in] kv_len Number of elements in the keys and values arrays
|
|
4749
4782
|
*
|
|
4750
4783
|
* \snippet{doc} snippets.dox OrtStatus Return Value
|
|
4784
|
+
*
|
|
4785
|
+
* \since Version 1.20.
|
|
4751
4786
|
*/
|
|
4752
4787
|
ORT_API2_STATUS(SetEpDynamicOptions, _Inout_ OrtSession* sess, _In_reads_(kv_len) const char* const* keys,
|
|
4753
4788
|
_In_reads_(kv_len) const char* const* values, _In_ size_t kv_len);
|
|
@@ -650,6 +650,9 @@ using AllocatedStringPtr = std::unique_ptr<char, detail::AllocatedFree>;
|
|
|
650
650
|
* constructors to construct an instance of a Status object from exceptions.
|
|
651
651
|
*/
|
|
652
652
|
struct Status : detail::Base<OrtStatus> {
|
|
653
|
+
using Base = detail::Base<OrtStatus>;
|
|
654
|
+
using Base::Base;
|
|
655
|
+
|
|
653
656
|
explicit Status(std::nullptr_t) noexcept {} ///< Create an empty object, must be assigned a valid one to be used
|
|
654
657
|
explicit Status(OrtStatus* status) noexcept; ///< Takes ownership of OrtStatus instance returned from the C API.
|
|
655
658
|
explicit Status(const Exception&) noexcept; ///< Creates status instance out of exception
|
|
@@ -728,6 +731,9 @@ struct Env : detail::Base<OrtEnv> {
|
|
|
728
731
|
*
|
|
729
732
|
*/
|
|
730
733
|
struct CustomOpDomain : detail::Base<OrtCustomOpDomain> {
|
|
734
|
+
using Base = detail::Base<OrtCustomOpDomain>;
|
|
735
|
+
using Base::Base;
|
|
736
|
+
|
|
731
737
|
explicit CustomOpDomain(std::nullptr_t) {} ///< Create an empty CustomOpDomain object, must be assigned a valid one to be used
|
|
732
738
|
|
|
733
739
|
/// \brief Wraps OrtApi::CreateCustomOpDomain
|
|
@@ -963,8 +969,10 @@ struct SessionOptions : detail::SessionOptionsImpl<OrtSessionOptions> {
|
|
|
963
969
|
*
|
|
964
970
|
*/
|
|
965
971
|
struct ModelMetadata : detail::Base<OrtModelMetadata> {
|
|
966
|
-
|
|
967
|
-
|
|
972
|
+
using Base = detail::Base<OrtModelMetadata>;
|
|
973
|
+
using Base::Base;
|
|
974
|
+
|
|
975
|
+
explicit ModelMetadata(std::nullptr_t) {} ///< Create an empty ModelMetadata object, must be assigned a valid one to be used
|
|
968
976
|
|
|
969
977
|
/** \brief Returns a copy of the producer name.
|
|
970
978
|
*
|
|
@@ -1237,6 +1245,9 @@ using ConstTensorTypeAndShapeInfo = detail::TensorTypeAndShapeInfoImpl<detail::U
|
|
|
1237
1245
|
*
|
|
1238
1246
|
*/
|
|
1239
1247
|
struct TensorTypeAndShapeInfo : detail::TensorTypeAndShapeInfoImpl<OrtTensorTypeAndShapeInfo> {
|
|
1248
|
+
using Base = detail::TensorTypeAndShapeInfoImpl<OrtTensorTypeAndShapeInfo>;
|
|
1249
|
+
using Base::Base;
|
|
1250
|
+
|
|
1240
1251
|
explicit TensorTypeAndShapeInfo(std::nullptr_t) {} ///< Create an empty TensorTypeAndShapeInfo object, must be assigned a valid one to be used
|
|
1241
1252
|
explicit TensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo* p) : TensorTypeAndShapeInfoImpl{p} {} ///< Used for interop with the C API
|
|
1242
1253
|
ConstTensorTypeAndShapeInfo GetConst() const { return ConstTensorTypeAndShapeInfo{this->p_}; }
|
|
@@ -1258,6 +1269,9 @@ using ConstSequenceTypeInfo = detail::SequenceTypeInfoImpl<detail::Unowned<const
|
|
|
1258
1269
|
*
|
|
1259
1270
|
*/
|
|
1260
1271
|
struct SequenceTypeInfo : detail::SequenceTypeInfoImpl<OrtSequenceTypeInfo> {
|
|
1272
|
+
using Base = detail::SequenceTypeInfoImpl<OrtSequenceTypeInfo>;
|
|
1273
|
+
using Base::Base;
|
|
1274
|
+
|
|
1261
1275
|
explicit SequenceTypeInfo(std::nullptr_t) {} ///< Create an empty SequenceTypeInfo object, must be assigned a valid one to be used
|
|
1262
1276
|
explicit SequenceTypeInfo(OrtSequenceTypeInfo* p) : SequenceTypeInfoImpl<OrtSequenceTypeInfo>{p} {} ///< Used for interop with the C API
|
|
1263
1277
|
ConstSequenceTypeInfo GetConst() const { return ConstSequenceTypeInfo{this->p_}; }
|
|
@@ -1293,6 +1307,9 @@ using ConstMapTypeInfo = detail::MapTypeInfoImpl<detail::Unowned<const OrtMapTyp
|
|
|
1293
1307
|
*
|
|
1294
1308
|
*/
|
|
1295
1309
|
struct MapTypeInfo : detail::MapTypeInfoImpl<OrtMapTypeInfo> {
|
|
1310
|
+
using Base = detail::MapTypeInfoImpl<OrtMapTypeInfo>;
|
|
1311
|
+
using Base::Base;
|
|
1312
|
+
|
|
1296
1313
|
explicit MapTypeInfo(std::nullptr_t) {} ///< Create an empty MapTypeInfo object, must be assigned a valid one to be used
|
|
1297
1314
|
explicit MapTypeInfo(OrtMapTypeInfo* p) : MapTypeInfoImpl<OrtMapTypeInfo>{p} {} ///< Used for interop with the C API
|
|
1298
1315
|
ConstMapTypeInfo GetConst() const { return ConstMapTypeInfo{this->p_}; }
|
|
@@ -1324,6 +1341,9 @@ using ConstTypeInfo = detail::TypeInfoImpl<detail::Unowned<const OrtTypeInfo>>;
|
|
|
1324
1341
|
/// the information about contained sequence or map depending on the ONNXType.
|
|
1325
1342
|
/// </summary>
|
|
1326
1343
|
struct TypeInfo : detail::TypeInfoImpl<OrtTypeInfo> {
|
|
1344
|
+
using Base = detail::TypeInfoImpl<OrtTypeInfo>;
|
|
1345
|
+
using Base::Base;
|
|
1346
|
+
|
|
1327
1347
|
explicit TypeInfo(std::nullptr_t) {} ///< Create an empty TypeInfo object, must be assigned a valid one to be used
|
|
1328
1348
|
explicit TypeInfo(OrtTypeInfo* p) : TypeInfoImpl<OrtTypeInfo>{p} {} ///< C API Interop
|
|
1329
1349
|
|
|
@@ -1661,11 +1681,11 @@ using UnownedValue = detail::ValueImpl<detail::Unowned<OrtValue>>;
|
|
|
1661
1681
|
*/
|
|
1662
1682
|
struct Value : detail::ValueImpl<OrtValue> {
|
|
1663
1683
|
using Base = detail::ValueImpl<OrtValue>;
|
|
1684
|
+
using Base::Base;
|
|
1664
1685
|
using OrtSparseValuesParam = detail::OrtSparseValuesParam;
|
|
1665
1686
|
using Shape = detail::Shape;
|
|
1666
1687
|
|
|
1667
|
-
explicit Value(std::nullptr_t) {}
|
|
1668
|
-
explicit Value(OrtValue* p) : Base{p} {} ///< Used for interop with the C API
|
|
1688
|
+
explicit Value(std::nullptr_t) {} ///< Create an empty Value object, must be assigned a valid one to be used
|
|
1669
1689
|
Value(Value&&) = default;
|
|
1670
1690
|
Value& operator=(Value&&) = default;
|
|
1671
1691
|
|
|
@@ -1941,6 +1961,10 @@ struct ArenaCfg : detail::Base<OrtArenaCfg> {
|
|
|
1941
1961
|
/// This struct provides life time management for custom op attribute
|
|
1942
1962
|
/// </summary>
|
|
1943
1963
|
struct OpAttr : detail::Base<OrtOpAttr> {
|
|
1964
|
+
using Base = detail::Base<OrtOpAttr>;
|
|
1965
|
+
using Base::Base;
|
|
1966
|
+
|
|
1967
|
+
explicit OpAttr(std::nullptr_t) {}
|
|
1944
1968
|
OpAttr(const char* name, const void* data, int len, OrtOpAttrType type);
|
|
1945
1969
|
};
|
|
1946
1970
|
|
|
@@ -2106,10 +2130,10 @@ struct KernelContext {
|
|
|
2106
2130
|
explicit KernelContext(OrtKernelContext* context);
|
|
2107
2131
|
size_t GetInputCount() const;
|
|
2108
2132
|
size_t GetOutputCount() const;
|
|
2109
|
-
// If input is optional and is not present, the method returns
|
|
2133
|
+
// If input is optional and is not present, the method returns an empty ConstValue
|
|
2110
2134
|
// which can be compared to nullptr.
|
|
2111
2135
|
ConstValue GetInput(size_t index) const;
|
|
2112
|
-
// If
|
|
2136
|
+
// If output is optional and is not present, the method returns an empty UnownedValue
|
|
2113
2137
|
// which can be compared to nullptr.
|
|
2114
2138
|
UnownedValue GetOutput(size_t index, const int64_t* dim_values, size_t dim_count) const;
|
|
2115
2139
|
UnownedValue GetOutput(size_t index, const std::vector<int64_t>& dims) const;
|
|
@@ -2183,6 +2207,8 @@ using ConstKernelInfo = detail::KernelInfoImpl<detail::Unowned<const OrtKernelIn
|
|
|
2183
2207
|
/// so it does not destroy the pointer the kernel does not own.
|
|
2184
2208
|
/// </summary>
|
|
2185
2209
|
struct KernelInfo : detail::KernelInfoImpl<OrtKernelInfo> {
|
|
2210
|
+
using Base = detail::KernelInfoImpl<OrtKernelInfo>;
|
|
2211
|
+
using Base::Base;
|
|
2186
2212
|
explicit KernelInfo(std::nullptr_t) {} ///< Create an empty instance to initialize later
|
|
2187
2213
|
explicit KernelInfo(OrtKernelInfo* info); ///< Take ownership of the instance
|
|
2188
2214
|
ConstKernelInfo GetConst() const { return ConstKernelInfo{this->p_}; }
|
|
@@ -2192,6 +2218,9 @@ struct KernelInfo : detail::KernelInfoImpl<OrtKernelInfo> {
|
|
|
2192
2218
|
/// Create and own custom defined operation.
|
|
2193
2219
|
/// </summary>
|
|
2194
2220
|
struct Op : detail::Base<OrtOp> {
|
|
2221
|
+
using Base = detail::Base<OrtOp>;
|
|
2222
|
+
using Base::Base;
|
|
2223
|
+
|
|
2195
2224
|
explicit Op(std::nullptr_t) {} ///< Create an empty Operator object, must be assigned a valid one to be used
|
|
2196
2225
|
|
|
2197
2226
|
explicit Op(OrtOp*); ///< Take ownership of the OrtOp
|
|
@@ -51,7 +51,7 @@ inline void ThrowOnError(const Status& st) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
inline Status::Status(OrtStatus* status) noexcept : Base<OrtStatus>{status} {
|
|
54
|
+
inline Status::Status(OrtStatus* status) noexcept : detail::Base<OrtStatus>{status} {
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
inline Status::Status(const std::exception& e) noexcept {
|
|
@@ -1908,7 +1908,7 @@ inline void attr_utils::GetAttrs(const OrtKernelInfo* p, const char* name, std::
|
|
|
1908
1908
|
|
|
1909
1909
|
inline KernelInfo::KernelInfo(OrtKernelInfo* info) : detail::KernelInfoImpl<OrtKernelInfo>{info} {}
|
|
1910
1910
|
|
|
1911
|
-
inline Op::Op(OrtOp* p) : Base<OrtOp>(p) {}
|
|
1911
|
+
inline Op::Op(OrtOp* p) : detail::Base<OrtOp>(p) {}
|
|
1912
1912
|
|
|
1913
1913
|
inline Op Op::Create(const OrtKernelInfo* info, const char* op_name, const char* domain, int version,
|
|
1914
1914
|
const char** type_constraint_names,
|