Commit ac37abf9 by Yitao Committed by Tianqi Chen

Fix a crash in android_deploy demo. (#2073)

parent 76b5a699
......@@ -298,7 +298,7 @@ public class MainActivity extends AppCompatActivity {
// 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 class MainActivity extends AppCompatActivity {
return matrix;
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment