File tree Expand file tree Collapse file tree 9 files changed +35
-0
lines changed
src/main/java/org/pytorch/executorch Expand file tree Collapse file tree 9 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ fb_android_library(
1010 "src/main/java/org/pytorch/executorch/Module.java" ,
1111 "src/main/java/org/pytorch/executorch/NativePeer.java" ,
1212 "src/main/java/org/pytorch/executorch/Tensor.java" ,
13+ "src/main/java/org/pytorch/executorch/annotations/Experimental.java" ,
1314 ],
1415 autoglob = False ,
1516 language = "JAVA" ,
@@ -24,6 +25,7 @@ fb_android_library(
2425 srcs = [
2526 "src/main/java/org/pytorch/executorch/LlamaCallback.java" ,
2627 "src/main/java/org/pytorch/executorch/LlamaModule.java" ,
28+ "src/main/java/org/pytorch/executorch/annotations/Experimental.java" ,
2729 ],
2830 autoglob = False ,
2931 language = "JAVA" ,
Original file line number Diff line number Diff line change 88
99package org .pytorch .executorch ;
1010
11+ import org .pytorch .executorch .annotations .Experimental ;
12+
1113/**
1214 * Codes representing tensor data types.
1315 *
1416 * <p>Warning: These APIs are experimental and subject to change without notice
1517 */
18+ @ Experimental
1619public enum DType {
1720 // NOTE: "jniCode" must be kept in sync with scalar_type.h.
1821 // NOTE: Never serialize "jniCode", because it can change between releases.
Original file line number Diff line number Diff line change 1111import com .facebook .jni .annotations .DoNotStrip ;
1212import java .util .Locale ;
1313import java .util .Optional ;
14+ import org .pytorch .executorch .annotations .Experimental ;
1415
1516/**
1617 * Java representation of an ExecuTorch value, which is implemented as tagged union that can be one
3031 *
3132 * <p>Warning: These APIs are experimental and subject to change without notice
3233 */
34+ @ Experimental
3335@ DoNotStrip
3436public class EValue {
3537 private static final int TYPE_CODE_NONE = 0 ;
Original file line number Diff line number Diff line change 99package org .pytorch .executorch ;
1010
1111import com .facebook .jni .annotations .DoNotStrip ;
12+ import org .pytorch .executorch .annotations .Experimental ;
1213
1314/**
1415 * Callback interface for Llama model. Users can implement this interface to receive the generated
1516 * tokens and statistics.
1617 *
1718 * <p>Warning: These APIs are experimental and subject to change without notice
1819 */
20+ @ Experimental
1921public interface LlamaCallback {
2022 /**
2123 * Called when a new result is available from JNI. Users will keep getting onResult() invocations
Original file line number Diff line number Diff line change 1212import com .facebook .jni .annotations .DoNotStrip ;
1313import com .facebook .soloader .nativeloader .NativeLoader ;
1414import com .facebook .soloader .nativeloader .SystemDelegate ;
15+ import org .pytorch .executorch .annotations .Experimental ;
1516
1617/**
1718 * LlamaModule is a wrapper around the Executorch Llama model. It provides a simple interface to
1819 * generate text from the model.
1920 *
2021 * <p>Warning: These APIs are experimental and subject to change without notice
2122 */
23+ @ Experimental
2224public class LlamaModule {
2325
2426 public static final int MODEL_TYPE_TEXT = 1 ;
Original file line number Diff line number Diff line change 1111import com .facebook .soloader .nativeloader .NativeLoader ;
1212import com .facebook .soloader .nativeloader .SystemDelegate ;
1313import java .util .Map ;
14+ import org .pytorch .executorch .annotations .Experimental ;
1415
1516/**
1617 * Java wrapper for ExecuTorch Module.
1718 *
1819 * <p>Warning: These APIs are experimental and subject to change without notice
1920 */
21+ @ Experimental
2022public class Module {
2123
2224 /** Load mode for the module. Load the whole file as a buffer. */
Original file line number Diff line number Diff line change 1212import com .facebook .jni .annotations .DoNotStrip ;
1313import com .facebook .soloader .nativeloader .NativeLoader ;
1414import java .util .Map ;
15+ import org .pytorch .executorch .annotations .Experimental ;
1516
1617/**
1718 * Interface for the native peer object for entry points to the Module
1819 *
1920 * <p>Warning: These APIs are experimental and subject to change without notice
2021 */
22+ @ Experimental
2123class NativePeer {
2224 static {
2325 // Loads libexecutorch.so from jniLibs
Original file line number Diff line number Diff line change 1919import java .nio .LongBuffer ;
2020import java .util .Arrays ;
2121import java .util .Locale ;
22+ import org .pytorch .executorch .annotations .Experimental ;
2223
2324/**
2425 * Representation of an ExecuTorch Tensor. Behavior is similar to PyTorch's tensor objects.
3940 *
4041 * <p>Warning: These APIs are experimental and subject to change without notice
4142 */
43+ @ Experimental
4244public abstract class Tensor {
4345 private static final String ERROR_MSG_DATA_BUFFER_NOT_NULL = "Data buffer must be not null" ;
4446 private static final String ERROR_MSG_DATA_ARRAY_NOT_NULL = "Data array must be not null" ;
Original file line number Diff line number Diff line change 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 .annotations ;
10+
11+ /**
12+ * This annotation indicates that an API is experimental and may change or be removed at any time.
13+ * It does not provide any guarantees for API stability or backward-compatibility.
14+ *
15+ * <p>This status is not permanent, and APIs marked with this annotation will need to be either made
16+ * more robust or removed in the future.
17+ */
18+ public @interface Experimental {}
You can’t perform that action at this time.
0 commit comments