Skip to content

Commit 7b32e47

Browse files
committed
data path support for ios
1 parent fe84495 commit 7b32e47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

extension/apple/ExecuTorch/Exported/ExecuTorchModule.mm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,22 @@ @implementation ExecuTorchModule {
249249
NSMutableDictionary<NSString *, NSMutableArray<ExecuTorchValue *> *> *_outputs;
250250
}
251251

252+
- (instancetype)initWithFilePath:(NSString *)filePath
253+
dataPath:(NSString *)dataPath
254+
loadMode:(ExecuTorchModuleLoadMode)loadMode {
255+
self = [super init];
256+
if (self) {
257+
_module = std::make_unique<Module>(
258+
filePath.UTF8String,
259+
dataPath.UTF8String,
260+
static_cast<Module::LoadMode>(loadMode)
261+
);
262+
_inputs = [NSMutableDictionary new];
263+
_outputs = [NSMutableDictionary new];
264+
}
265+
return self;
266+
}
267+
252268
- (instancetype)initWithFilePath:(NSString *)filePath
253269
loadMode:(ExecuTorchModuleLoadMode)loadMode {
254270
self = [super init];

0 commit comments

Comments
 (0)