Skip to content

Commit 5d7d8ca

Browse files
authored
Temporarily fixed version number is 1
I think we can temporarily fix the version number to 1, and then tf2.x declares the Implementation-Version.
1 parent 5715576 commit 5d7d8ca

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ public static void load() {
7171
log("frameworkResourceName: " + frameworkResourceName);
7272
final InputStream frameworkResource =
7373
NativeLibrary.class.getClassLoader().getResourceAsStream(frameworkResourceName);
74-
if ("libtensorflow_framework.so".equals(frameworkLibName)) {
75-
frameworkLibName = "libtensorflow_framework.so.1";
76-
}
77-
if ("libtensorflow_framework.dylib".equals(frameworkLibName)) {
78-
frameworkLibName = "libtensorflow_framework.1.dylib";
79-
}
8074
// Do not complain if the framework resource wasn't found. This may just mean that we're
8175
// building with --config=monolithic (in which case it's not needed and not included).
8276
if (jniResource == null) {
@@ -139,9 +133,9 @@ private static boolean resourceExists(String baseName) {
139133

140134
private static String getVersionedLibraryName(String libFilename) {
141135
// If the resource exists as an unversioned file, return that.
142-
if (resourceExists(libFilename)) {
143-
return libFilename;
144-
}
136+
// if (resourceExists(libFilename)) {
137+
// return libFilename;
138+
// }
145139

146140
final String versionName = getMajorVersionNumber();
147141

@@ -180,11 +174,13 @@ private static String getVersionedLibraryName(String libFilename) {
180174
* determined.
181175
*/
182176
private static String getMajorVersionNumber() {
177+
// getImplementationVersion() retrun null.
183178
String version = NativeLibrary.class.getPackage().getImplementationVersion();
184179
// expecting a string like 1.14.0, we want to get the first '1'.
185180
int dotIndex;
186181
if (version == null || (dotIndex = version.indexOf('.')) == -1) {
187-
return null;
182+
// we want to get the version 1.
183+
return "1";
188184
}
189185
String majorVersion = version.substring(0, dotIndex);
190186
try {

0 commit comments

Comments
 (0)