From f319ece596e703f32a642ff3b20793396df3ebe6 Mon Sep 17 00:00:00 2001 From: Yitao Date: Wed, 7 Nov 2018 14:48:33 +0800 Subject: [PATCH] Fix a crash in android_deploy demo. --- .../src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java b/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java index f3cdefe1c2ff..7d391856f599 100644 --- a/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java +++ b/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java @@ -298,7 +298,7 @@ protected Integer doInBackground(Bitmap... bitmaps) { // get the function from the module(get output data) Log.i(TAG, "get output data"); - NDArray outputNdArray = NDArray.empty(new long[]{1000}, new TVMType("float32")); + NDArray outputNdArray = NDArray.empty(new long[]{1, 1000}, new TVMType("float32")); Function getOutputFunc = graphRuntimeModule.getFunction("get_output"); getOutputFunc.pushArg(OUTPUT_INDEX).pushArg(outputNdArray).invoke(); float[] output = outputNdArray.asFloatArray(); @@ -630,4 +630,4 @@ public static Matrix getTransformationMatrix( return matrix; } -} \ No newline at end of file +}