Skip to content

Commit 7de5978

Browse files
committed
Remove unused Map<String, String> extraFiles in Module.load
1 parent 1327090 commit 7de5978

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

extension/android/jni/jni_layer.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,11 @@ class ExecuTorchJni : public facebook::jni::HybridClass<ExecuTorchJni> {
243243
static facebook::jni::local_ref<jhybriddata> initHybrid(
244244
facebook::jni::alias_ref<jclass>,
245245
facebook::jni::alias_ref<jstring> modelPath,
246-
facebook::jni::alias_ref<
247-
facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>>
248-
extraFiles,
249246
jint loadMode) {
250-
return makeCxxInstance(modelPath, extraFiles, loadMode);
247+
return makeCxxInstance(modelPath, loadMode);
251248
}
252249

253-
ExecuTorchJni(
254-
facebook::jni::alias_ref<jstring> modelPath,
255-
facebook::jni::alias_ref<
256-
facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>>
257-
extraFiles,
258-
jint loadMode) {
250+
ExecuTorchJni(facebook::jni::alias_ref<jstring> modelPath, jint loadMode) {
259251
Module::LoadMode load_mode = Module::LoadMode::Mmap;
260252
if (loadMode == 0) {
261253
load_mode = Module::LoadMode::File;

extension/android/src/main/java/org/pytorch/executorch/Module.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,19 @@ public class Module {
3636
/** Reference to the NativePeer object of this module. */
3737
private NativePeer mNativePeer;
3838

39-
/**
40-
* Loads a serialized ExecuTorch module from the specified path on the disk. Uses default load
41-
* FILE.
42-
*
43-
* @param modelPath path to file that contains the serialized ExecuTorch module.
44-
* @param extraFiles map with extra files names as keys, content of them will be loaded to values.
45-
* @return new {@link org.pytorch.executorch.Module} object which owns the model module.
46-
*/
47-
public static Module load(final String modelPath, final Map<String, String> extraFiles) {
48-
return load(modelPath, extraFiles, LOAD_MODE_FILE);
49-
}
50-
5139
/**
5240
* Loads a serialized ExecuTorch module from the specified path on the disk.
5341
*
5442
* @param modelPath path to file that contains the serialized ExecuTorch module.
55-
* @param extraFiles map with extra files names as keys, content of them will be loaded to values.
5643
* @param loadMode load mode for the module. See constants in {@link Module}.
5744
* @return new {@link org.pytorch.executorch.Module} object which owns the model module.
5845
*/
5946
public static Module load(
60-
final String modelPath, final Map<String, String> extraFiles, int loadMode) {
47+
final String modelPath, int loadMode) {
6148
if (!NativeLoader.isInitialized()) {
6249
NativeLoader.init(new SystemDelegate());
6350
}
64-
return new Module(new NativePeer(modelPath, extraFiles, loadMode));
51+
return new Module(new NativePeer(modelPath, loadMode));
6552
}
6653

6754
/**
@@ -71,7 +58,7 @@ public static Module load(
7158
* @return new {@link org.pytorch.executorch.Module} object which owns the model module.
7259
*/
7360
public static Module load(final String modelPath) {
74-
return load(modelPath, null);
61+
return load(modelPath, LOAD_MODE_FILE);
7562
}
7663

7764
Module(NativePeer nativePeer) {

extension/android/src/main/java/org/pytorch/executorch/NativePeer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ class NativePeer {
3030

3131
@DoNotStrip
3232
private static native HybridData initHybrid(
33-
String moduleAbsolutePath, Map<String, String> extraFiles, int loadMode);
33+
String moduleAbsolutePath, int loadMode);
3434

35-
NativePeer(String moduleAbsolutePath, Map<String, String> extraFiles, int loadMode) {
36-
mHybridData = initHybrid(moduleAbsolutePath, extraFiles, loadMode);
35+
NativePeer(String moduleAbsolutePath, int loadMode) {
36+
mHybridData = initHybrid(moduleAbsolutePath, loadMode);
3737
}
3838

3939
/** Clean up the native resources associated with this instance */

0 commit comments

Comments
 (0)