pytorch / android-demo-app

PyTorch android examples of usage in applications
1.46k stars 604 forks source link

com.facebook.jni.CppException: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. #205

Open bestpower opened 2 years ago

bestpower commented 2 years ago

In android app, my model output array as float[][], but can not get the output tensor as codes:

outputTensor = module.forward(IValue.from(inputTensor)).toTensor();

How to solve please?

96005900 commented 1 year ago

I have the same question,how to solve it?