sync repo source code with rel-1.15.0 and update yml files into two stages

This commit is contained in:
rachguo
2023-07-14 11:45:08 -07:00
parent a2f312d30e
commit 9f58d76d7c
29 changed files with 577 additions and 452 deletions
+8 -10
View File
@@ -85,9 +85,9 @@ bool SafeMultiply(size_t a, size_t b, size_t& out) {
memoryInfo, tensorData.mutableBytes, tensorData.length,
shapeVector.data(), shapeVector.size(), ONNXElementType);
return [self initWithCXXAPIOrtValue:std::move(ortValue)
externalTensorData:tensorData
error:error];
return [self initWithCAPIOrtValue:ortValue.release()
externalTensorData:tensorData
error:error];
}
ORT_OBJC_API_IMPL_CATCH_RETURNING_NULLABLE(error)
}
@@ -129,19 +129,17 @@ bool SafeMultiply(size_t a, size_t b, size_t& out) {
#pragma mark - Internal
- (nullable instancetype)initWithCXXAPIOrtValue:(Ort::Value&&)existingCXXAPIOrtValue
externalTensorData:(nullable NSMutableData*)externalTensorData
error:(NSError**)error {
- (nullable instancetype)initWithCAPIOrtValue:(OrtValue*)CAPIOrtValue
externalTensorData:(nullable NSMutableData*)externalTensorData
error:(NSError**)error {
if ((self = [super init]) == nil) {
return nil;
}
try {
_typeInfo = existingCXXAPIOrtValue.GetTypeInfo();
_value = Ort::Value{CAPIOrtValue};
_typeInfo = _value->GetTypeInfo();
_externalTensorData = externalTensorData;
// transfer C++ Ort::Value ownership to this instance
_value = std::move(existingCXXAPIOrtValue);
return self;
}
ORT_OBJC_API_IMPL_CATCH_RETURNING_NULLABLE(error);