aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/java/src
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-03-13 15:42:34 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-13 16:42:50 -0700
commit86dd46a3c65c3bcdf92b7ea3ab33bc99ece58236 (patch)
tree9230b4e3dbaca45d6481d44a05dd551402142e28 /tensorflow/contrib/lite/java/src
parent6a99d23094e953fcd01a86acf2543958fd7bd5bb (diff)
Merged commit includes the following changes:
188942386 by mikecase: Internal Change. -- 188941669 by A. Unique TensorFlower: Change TensorFlow Lite Java Interpreter to use Checker Framework @NonNull annotation -- 188937484 by zhixianyan: Convert saved_model to tflite flatbuffer. -- PiperOrigin-RevId: 188942386
Diffstat (limited to 'tensorflow/contrib/lite/java/src')
-rw-r--r--tensorflow/contrib/lite/java/src/main/java/org/tensorflow/lite/Interpreter.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/tensorflow/contrib/lite/java/src/main/java/org/tensorflow/lite/Interpreter.java b/tensorflow/contrib/lite/java/src/main/java/org/tensorflow/lite/Interpreter.java
index 9e47e921a6..cc17b491f2 100644
--- a/tensorflow/contrib/lite/java/src/main/java/org/tensorflow/lite/Interpreter.java
+++ b/tensorflow/contrib/lite/java/src/main/java/org/tensorflow/lite/Interpreter.java
@@ -19,7 +19,7 @@ import java.io.File;
import java.nio.MappedByteBuffer;
import java.util.HashMap;
import java.util.Map;
-import javax.validation.constraints.NotNull;
+import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Driver class to drive model inference with TensorFlow Lite.
@@ -60,7 +60,7 @@ public final class Interpreter implements AutoCloseable {
*
* @param modelFile: a File of a pre-trained TF Lite model.
*/
- public Interpreter(@NotNull File modelFile) {
+ public Interpreter(@NonNull File modelFile) {
if (modelFile == null) {
return;
}
@@ -73,7 +73,7 @@ public final class Interpreter implements AutoCloseable {
* <p>The {@code MappedByteBuffer} should remain unchanged after the construction of a {@code
* Interpreter}.
*/
- public Interpreter(@NotNull MappedByteBuffer mappedByteBuffer) {
+ public Interpreter(@NonNull MappedByteBuffer mappedByteBuffer) {
wrapper = new NativeInterpreterWrapper(mappedByteBuffer);
}
@@ -89,7 +89,7 @@ public final class Interpreter implements AutoCloseable {
* model inference is done.
* @param output a multidimensional array of output data.
*/
- public void run(@NotNull Object input, @NotNull Object output) {
+ public void run(@NonNull Object input, @NonNull Object output) {
Object[] inputs = {input};
Map<Integer, Object> outputs = new HashMap<>();
outputs.put(0, output);
@@ -111,7 +111,7 @@ public final class Interpreter implements AutoCloseable {
* needs to keep entries for the outputs to be used.
*/
public void runForMultipleInputsOutputs(
- @NotNull Object[] inputs, @NotNull Map<Integer, Object> outputs) {
+ @NonNull Object[] inputs, @NonNull Map<Integer, Object> outputs) {
if (wrapper == null) {
throw new IllegalStateException("The Interpreter has already been closed.");
}
@@ -134,7 +134,7 @@ public final class Interpreter implements AutoCloseable {
*
* <p>IllegalArgumentException will be thrown if it fails to resize.
*/
- public void resizeInput(int idx, @NotNull int[] dims) {
+ public void resizeInput(int idx, @NonNull int[] dims) {
if (wrapper == null) {
throw new IllegalStateException("The Interpreter has already been closed.");
}