Update to 1.18.0 resources (#17)

* update to 1.18.0 resources

* Update Package.swift

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* update

---------

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
This commit is contained in:
Rachel Guo
2024-06-04 15:41:38 -07:00
committed by GitHub
parent ce64739c6d
commit 11c7dd6dd4
9 changed files with 53 additions and 14 deletions
+4 -2
View File
@@ -7,6 +7,7 @@
#include <vector>
#import "cxx_api.h"
#import "cxx_utils.h"
#import "error_utils.h"
#import "ort_enums_internal.h"
#import "ort_env_internal.h"
@@ -23,6 +24,7 @@ enum class NamedValueType {
NS_ASSUME_NONNULL_BEGIN
@implementation ORTSession {
ORTEnv* _env; // keep a strong reference so the ORTEnv doesn't get destroyed before this does
std::optional<Ort::Session> _session;
}
@@ -44,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}
_env = env;
_session = Ort::Session{[env CXXAPIOrtEnv],
path.UTF8String,
[sessionOptions CXXAPIOrtSessionOptions]};
@@ -196,8 +199,7 @@ NS_ASSUME_NONNULL_BEGIN
for (size_t i = 0; i < nameCount; ++i) {
auto name = getName(i, allocator);
NSString* nameNsstr = [NSString stringWithUTF8String:name.get()];
NSAssert(nameNsstr != nil, @"nameNsstr must not be nil");
NSString* nameNsstr = utils::toNSString(name.get());
[result addObject:nameNsstr];
}