Error: XNNPACK Linear not available

Hi all. I faced one problem… It will be great if someone could help me…

I just trained one nn like this:

traced_script_module = torch.jit.trace(model, example)
traced_script_module_optimized = optimize_for_mobile(traced_script_module)
traced_script_module_optimized._save_for_lite_interpreter("app/src/main/assets/model.ptl")```


Than, I'm loading it (Andoid, java):

        

Module module = LiteModuleLoader.load(assetFilePath(“model.ptl”), null, Device.CPU);
module.forward(IValue.from(t));


My build_gradle:

implementation 'org.pytorch:pytorch_android_lite:1.12.1'
implementation 'org.pytorch:pytorch_android_torchvision_lite:1.12.1'

pytorch version in python 1.12.1

After all, while debugging I see, than on module.forward I get this error:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mlapplication, PID: 11326
com.facebook.jni.CppException: XNNPACK Linear not available! Reason: The provided (weight, bias, output_min, output_max) parameters are either invalid individually or their combination is not supported by XNNPACK.

  Debug info for handle(s): debug_handles:{-1}, was not found.
  
Exception raised from create at ../aten/src/ATen/native/xnnpack/Linear.cpp:84 (most recent call first):
(no backtrace available)
    at org.pytorch.LiteNativePeer.forward(Native Method)
    at org.pytorch.Module.forward(Module.java:52)
    at com.example.mlapplication.PyTorch_Model.Predict(PyTorch_Model.java:109)
    at com.example.mlapplication.GetSensors$AccelerometerListener.onSensorChanged(GetSensors.java:58)
    at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:886)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:335)
    at android.os.Looper.loopOnce(Looper.java:161)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7876)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)