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:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user