-
Notifications
You must be signed in to change notification settings - Fork 649
Add support for data path in iOS #13620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13620
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 1198433 with merge base 4598fdb ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
} | ||
return self; | ||
} | ||
|
||
- (instancetype)initWithFilePath:(NSString *)filePath | ||
loadMode:(ExecuTorchModuleLoadMode)loadMode { | ||
self = [super init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should just call the newly added with an empty data path, just like the one below calling it with the default load mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have to pass in nil, which means the other constructor needs to cover both cases as well.
e6a920f
to
0b78b72
Compare
0b78b72
to
2633a9d
Compare
if (dataFilePath) { | ||
_module = std::make_unique<Module>( | ||
filePath.UTF8String, | ||
dataFilePath.UTF8String, | ||
static_cast<Module::LoadMode>(loadMode) | ||
); | ||
_inputs = [NSMutableDictionary new]; | ||
_outputs = [NSMutableDictionary new]; | ||
} else { | ||
_module = std::make_unique<Module>( | ||
filePath.UTF8String, | ||
static_cast<Module::LoadMode>(loadMode) | ||
); | ||
_inputs = [NSMutableDictionary new]; | ||
_outputs = [NSMutableDictionary new]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (dataFilePath) { | |
_module = std::make_unique<Module>( | |
filePath.UTF8String, | |
dataFilePath.UTF8String, | |
static_cast<Module::LoadMode>(loadMode) | |
); | |
_inputs = [NSMutableDictionary new]; | |
_outputs = [NSMutableDictionary new]; | |
} else { | |
_module = std::make_unique<Module>( | |
filePath.UTF8String, | |
static_cast<Module::LoadMode>(loadMode) | |
); | |
_inputs = [NSMutableDictionary new]; | |
_outputs = [NSMutableDictionary new]; | |
} | |
_module = std::make_unique<Module>( | |
filePath.UTF8String, | |
dataFilePath.UTF8String, | |
static_cast<Module::LoadMode>(loadMode) | |
); | |
_inputs = [NSMutableDictionary new]; | |
_outputs = [NSMutableDictionary new]; |
- (instancetype)initWithFilePath:(NSString *)filePath | ||
loadMode:(ExecuTorchModuleLoadMode)loadMode { | ||
return [self initWithFilePath:filePath | ||
dataFilePath:nil | ||
loadMode:loadMode]; | ||
} | ||
|
||
- (instancetype)initWithFilePath:(NSString *)filePath { | ||
return [self initWithFilePath:filePath loadMode:ExecuTorchModuleLoadModeFile]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (instancetype)initWithFilePath:(NSString *)filePath | |
loadMode:(ExecuTorchModuleLoadMode)loadMode { | |
return [self initWithFilePath:filePath | |
dataFilePath:nil | |
loadMode:loadMode]; | |
} | |
- (instancetype)initWithFilePath:(NSString *)filePath { | |
return [self initWithFilePath:filePath loadMode:ExecuTorchModuleLoadModeFile]; | |
} | |
- (instancetype)initWithFilePath:(NSString *)filePath | |
loadMode:(ExecuTorchModuleLoadMode)loadMode { | |
return [self initWithFilePath:filePath | |
dataFilePath:@"" | |
loadMode:loadMode]; | |
} | |
- (instancetype)initWithFilePath:(NSString *)filePath { | |
return [self initWithFilePath:filePath | |
dataFilePath:@"" | |
loadMode:ExecuTorchModuleLoadModeFile]; | |
} |
dataFilePath:(NSString *)dataPath | ||
loadMode:(ExecuTorchModuleLoadMode)loadMode | ||
NS_DESIGNATED_INITIALIZER; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove NS_DESIGNATED_INITIALIZER
from the other constructor at L150 now.
Seems like mostly linter changes..