Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ buildscript {
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Expand All @@ -38,5 +38,5 @@ allprojects {

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'org.tensorflow:tensorflow-android:1.3.0'
compile 'org.tensorflow:tensorflow-android:+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public void feed(String id, ReadableMap data, Promise promise) {
inference.feed(inputName, Tensor.create(shape, IntBuffer.wrap(srcData)));
} else if(dtype == DataType.BOOL) {
byte[] srcData = readableArrayToByteBoolArray(data.getArray("data"));
inference.feed(inputName, Tensor.create(dtype, shape, ByteBuffer.wrap(srcData)));
inference.feed(inputName, Tensor.create(Boolean.class, shape, ByteBuffer.wrap(srcData)));
} else if(dtype == DataType.STRING) {
byte[] srcData = readableArrayToByteStringArray(data.getArray("data"));
inference.feed(inputName, Tensor.create(dtype, shape, ByteBuffer.wrap(srcData)));
inference.feed(inputName, Tensor.create(String.class, shape, ByteBuffer.wrap(srcData)));
} else {
promise.reject(new IllegalArgumentException("Data type is not supported"));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void run(String[] outputNames, boolean enableStats) {
for (String outputName : outputNames) {
tfContext.runner.fetch(outputName);
}
List<Tensor> tensors = tfContext.runner.run();
List<Tensor<?>> tensors = tfContext.runner.run();

tfContext.outputTensors.clear();
for (int i = 0; i < outputNames.length; i++) {
Expand Down