Skip to content

Commit e119d51

Browse files
authored
Add more docs and give API warning in ET Java
Differential Revision: D62216121 Pull Request resolved: #5097
1 parent e4a2322 commit e119d51

File tree

7 files changed

+31
-3
lines changed

7 files changed

+31
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
package org.pytorch.executorch;
1010

11-
/** Codes representing tensor data types. */
11+
/**
12+
* Codes representing tensor data types.
13+
*
14+
* <p>Warning: These APIs are experimental and subject to change without notice
15+
*/
1216
public enum DType {
1317
// NOTE: "jniCode" must be kept in sync with scalar_type.h.
1418
// NOTE: Never serialize "jniCode", because it can change between releases.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*
2828
* <p>{@code EValue} objects may retain references to objects passed into their constructors, and
2929
* may return references to their internal state from {@code toX()}.
30+
*
31+
* <p>Warning: These APIs are experimental and subject to change without notice
3032
*/
3133
@DoNotStrip
3234
public class EValue {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
import com.facebook.jni.annotations.DoNotStrip;
1212

13+
/**
14+
* Callback interface for Llama model. Users can implement this interface to receive the generated
15+
* tokens and statistics.
16+
*
17+
* <p>Warning: These APIs are experimental and subject to change without notice
18+
*/
1319
public interface LlamaCallback {
1420
/**
1521
* Called when a new result is available from JNI. Users will keep getting onResult() invocations

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
import com.facebook.soloader.nativeloader.NativeLoader;
1414
import com.facebook.soloader.nativeloader.SystemDelegate;
1515

16+
/**
17+
* LlamaModule is a wrapper around the Executorch Llama model. It provides a simple interface to
18+
* generate text from the model.
19+
*
20+
* <p>Warning: These APIs are experimental and subject to change without notice
21+
*/
1622
public class LlamaModule {
1723

1824
public static final int MODEL_TYPE_TEXT = 1;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import com.facebook.soloader.nativeloader.SystemDelegate;
1313
import java.util.Map;
1414

15-
/** Java wrapper for ExecuTorch Module. */
15+
/**
16+
* Java wrapper for ExecuTorch Module.
17+
*
18+
* <p>Warning: These APIs are experimental and subject to change without notice
19+
*/
1620
public class Module {
1721

1822
/** Load mode for the module. Load the whole file as a buffer. */

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
import com.facebook.soloader.nativeloader.NativeLoader;
1414
import java.util.Map;
1515

16-
/** Interface for the native peer object for entry points to the Module */
16+
/**
17+
* Interface for the native peer object for entry points to the Module
18+
*
19+
* <p>Warning: These APIs are experimental and subject to change without notice
20+
*/
1721
class NativePeer {
1822
static {
1923
// Loads libexecutorch.so from jniLibs

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
* between {@link Module} calls to avoid reallocation. Data retrieved from {@code Tensor} objects
3737
* may be copied or may be a reference to the {@code Tensor}'s internal data buffer. {@code shape}
3838
* is always copied.
39+
*
40+
* <p>Warning: These APIs are experimental and subject to change without notice
3941
*/
4042
public abstract class Tensor {
4143
private static final String ERROR_MSG_DATA_BUFFER_NOT_NULL = "Data buffer must be not null";

0 commit comments

Comments
 (0)