RuntimeException: empty not implemented for TensorTypeSet

I’ve exported Pytorch model for android and trying to load Module I’ve got the following error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.demo/org.pytorch.demo.vision.FrameProcessingActivity}: com.facebook.jni.CppException: empty not implemented for TensorTypeSet(VariableTensorId, CUDATensorId) (empty at aten/src/ATen/Functions.h:3679)
(no backtrace available)

whole stack trace is:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.pytorch.demo, PID: 19189
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.demo/org.pytorch.demo.vision.FrameProcessingActivity}: com.facebook.jni.CppException: empty not implemented for TensorTypeSet(VariableTensorId, CUDATensorId) (empty at aten/src/ATen/Functions.h:3679)
(no backtrace available)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5389)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
Caused by: com.facebook.jni.CppException: empty not implemented for TensorTypeSet(VariableTensorId, CUDATensorId) (empty at aten/src/ATen/Functions.h:3679)
(no backtrace available)
at org.pytorch.NativePeer.initHybrid(Native Method)
at org.pytorch.NativePeer.(NativePeer.java:18)
at org.pytorch.Module.load(Module.java:23)
at org.pytorch.demo.models.BeautyDefiner.(BeautyDefiner.java:23)
at org.pytorch.demo.vision.FrameProcessingActivity.onCreate(FrameProcessingActivity.java:83)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
… 10 more

How to solve that error?

The problem was that I ran the model on the gpu before exporting with jit.
So I move the model to cpu and exported the model again.
And it worked.