2021-04-27 17:06:30 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
2021-05-05 22:56:55 +00:00
|
|
|
#import "ort_value.h"
|
2021-04-27 17:06:30 +00:00
|
|
|
|
2023-04-20 06:18:35 +00:00
|
|
|
#import "cxx_api.h"
|
2021-04-27 17:06:30 +00:00
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
@interface ORTValue ()
|
|
|
|
|
|
2023-06-30 00:37:16 +00:00
|
|
|
/**
|
|
|
|
|
* Creates a value from an existing C++ API Ort::Value and takes ownership from it.
|
|
|
|
|
* Note: Ownership is guaranteed to be transferred on success but not otherwise.
|
|
|
|
|
*
|
|
|
|
|
* @param existingCXXAPIOrtValue The existing C++ API Ort::Value.
|
|
|
|
|
* @param externalTensorData Any external tensor data referenced by `existingCXXAPIOrtValue`.
|
|
|
|
|
* @param error Optional error information set if an error occurs.
|
|
|
|
|
* @return The instance, or nil if an error occurs.
|
|
|
|
|
*/
|
|
|
|
|
- (nullable instancetype)initWithCXXAPIOrtValue:(Ort::Value&&)existingCXXAPIOrtValue
|
|
|
|
|
externalTensorData:(nullable NSMutableData*)externalTensorData
|
|
|
|
|
error:(NSError**)error NS_DESIGNATED_INITIALIZER;
|
2021-04-27 17:06:30 +00:00
|
|
|
|
|
|
|
|
- (Ort::Value&)CXXAPIOrtValue;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|