From 7e26e62bddd2f659d018e40f784c24cbf7776114 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Tue, 11 Apr 2023 17:59:27 -0700 Subject: [PATCH] [pytorch] Fixes binary location check for 2.0 --- .../src/main/java/ai/djl/pytorch/jni/LibUtils.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java b/engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java index ec954184ce7..4214f125f63 100644 --- a/engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java +++ b/engines/pytorch/pytorch-engine/src/main/java/ai/djl/pytorch/jni/LibUtils.java @@ -313,15 +313,7 @@ private static LibTorch copyNativeLibraryFromClasspath(Platform platform) { if (!m.matches()) { throw new AssertionError("Unexpected version: " + version); } - String[] versions = m.group(1).split("\\."); - int minorVersion = Integer.parseInt(versions[1]); - int buildVersion = Integer.parseInt(versions[2]); - String pathPrefix; - if (minorVersion > 10 || (minorVersion == 10 && buildVersion == 2)) { - pathPrefix = "pytorch/" + flavor + '/' + classifier; - } else { - pathPrefix = "native/lib"; - } + String pathPrefix = "pytorch/" + flavor + '/' + classifier; Files.createDirectories(cacheDir); tmp = Files.createTempDirectory(cacheDir, "tmp");