Skip to content

Commit b69a166

Browse files
committed
metadata
1 parent df90bdd commit b69a166

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
package org.pytorch.executorch;
10+
11+
/**
12+
* Helper class to access the metadata for a method from a Module
13+
*/
14+
public class MethodMetadata {
15+
private String name;
16+
17+
public String getName() {
18+
return name;
19+
}
20+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ public class Module {
4949

5050
private final HybridData mHybridData;
5151

52+
private final MethodMetadata[] mMethodMetadata;
53+
5254
@DoNotStrip
5355
private static native HybridData initHybrid(String moduleAbsolutePath, int loadMode);
5456

5557
private Module(String moduleAbsolutePath, int loadMode) {
5658
mHybridData = initHybrid(moduleAbsolutePath, loadMode);
59+
60+
populateMethodMeta();
61+
}
62+
63+
void populateMethodMeta() {
64+
mMethodMetadata = new MethodMetadata[1];
5765
}
5866

5967
/** Lock protecting the non-thread safe methods in mHybridData. */

0 commit comments

Comments
 (0)