Repository: pytorch
Issue: No pytorch_jni.dll file in libtorch 1.13.0 lib folder
Labels: oncall: java

### 🐛 Describe the bug

# Run details
I am trying to load and run inference on a pytorch model in java using the code below:
```java
import org.pytorch.IValue;
import org.pytorch.Module;
import org.pytorch.Tensor;
import java.util.Arrays;
public class App
{
    public static void main( String[] args )
    {
        Module mod = Module.load("demo-model.pt1");
        Tensor data = Tensor.fromBlob(new int[] {1, 2, 3, 4, 5, 6}, new long[] {2, 3} );
        IValue result = mod.forward(IValue.from(data), IValue.from(3.0));
        Tensor output = result.toTensor();
        System.out.println("shape: " + Arrays.toString(output.shape()));
        System.out.println("data: " + Arrays.toString(output.getDataAsFloatArray()));
        System.exit(0);
    }
}
```
To run I am:
* Adding downloaded and extracted `libtorch 1.13.0` to system path:
```set PATH=%PATH%;\libtorch1.13.0\lib;```
* Compiling and running with required jars: `pytorch_java_only 1.12.2`, `nativeloader 0.10.4`, `fbjni-java-only 0.3.0`:
```
javac -cp ".;\pytorch_java_only\1.12.2\pytorch_java_only-1.12.2.jar;\nativeloader\0.10.4\nativeloader-0.10.4.jar;\fbjni-java-only\0.3.0\fbjni-java-only-0.3.0.jar;" App.java
```
```
java -cp ".;\pytorch_java_only\1.12.2\pytorch_java_only-1.12.2.jar;\nativeloader\0.10.4\nativeloader-0.10.4.jar;\fbjni-java-only\0.3.0\fbjni-java-only-0.3.0.jar;" App
```
# Error 
The error I am getting pertains to the `pytorch_jni.dll` file not being present in newer versions of libtorch. Libtorch>1.10.0
![image](https://user-images.githubusercontent.com/31966678/204647514-01882771-0dc8-4341-b1b0-a8c4ac02c669.png)

# Reason for error and possible fixes
* The error seems to happen in newer visions of libtorch. i.e: Libtorch>1.10.0
* The above error **DOES NOT** happen with `libtorch 1.10.0` as the `pytorch_jni.dll` is present in the lib folder:
![image](https://user-images.githubusercontent.com/31966678/204649370-fb38ac84-1b9a-4875-812d-d0f55b843da1.png)
* The error **DOES** happen with `libtorch 1.13.0` as the `pytorch_jni.dll` is **NOT** present in the lib folder. Instead there is `libtorch_jni.so`:
![image](https://user-images.githubusercontent.com/31966678/204650551-f531baf6-1b6b-45b9-8699-2221c401f037.png)
* There seems to be a `libtorch_jni.so` file in libtorch 1.13.0 but no `pytorch_jni.dll`. 
* Could this issue be fixed with updating `pytorch_java_only 1.12.2` to look for and read `libtorch_jni.so` in  libtorch vesions > 1.10.0 instead of `pytorch_jni.dll`.
* Please make fixes to use pytorch_java_only with newer versions of libtorch. This would be much appreciated. Thanks.

https://github.com/pytorch/java-demo/issues/25
https://github.com/pytorch/java-demo/issues/6

### Versions

* libtorch 1.13.0 (https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.13.0%2Bcpu.zip)
* pytorch_java_only 1.12.2  (https://mvnrepository.com/artifact/org.pytorch/pytorch_java_only/1.12.2)
* nativeloader 0.10.4 (https://mvnrepository.com/artifact/com.facebook.soloader/nativeloader/0.10.4)
* fbjni-java-only 0.3.0 (https://mvnrepository.com/artifact/com.facebook.fbjni/fbjni-java-only/0.3.0)