Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit df82c51

Browse files
committed
Update load model API
1 parent 512e79d commit df82c51

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

HelloWorld/HelloWorld/HelloWorld/TorchBridge/TorchModule.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
@implementation TorchModule {
55
@protected
6-
torch::jit::script::Module _impl;
6+
torch::jit::mobile::Module _impl;
77
}
88

99
- (nullable instancetype)initWithFileAtPath:(NSString*)filePath {
1010
self = [super init];
1111
if (self) {
1212
try {
13-
_impl = torch::jit::load(filePath.UTF8String);
14-
_impl.eval();
13+
_impl = torch::jit::_load_for_mobile(filePath.UTF8String);
1514
} catch (const std::exception& exception) {
1615
NSLog(@"%s", exception.what());
1716
return nil;

0 commit comments

Comments
 (0)