Skip to content

Commit b2f98bc

Browse files
committed
Patch SavedModel Android deps
1 parent 672c807 commit b2f98bc

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

scripts/patch_tfjava.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,38 @@ def patch_workspace(path: Path) -> None:
350350
"""
351351

352352

353+
SAVED_MODEL_ANDROID_DEPS_PATCH = """--- a/tensorflow/cc/saved_model/BUILD
354+
+++ b/tensorflow/cc/saved_model/BUILD
355+
@@ -50,6 +50,8 @@
356+
# tf_lib depending on the build platform.
357+
"//tensorflow/core:lib",
358+
"//tensorflow/core:protos_all_cc",
359+
+ ]) + if_android([
360+
+ "//tensorflow/core:android_tensorflow_lib",
361+
]),
362+
)
363+
364+
@@ -98,6 +100,8 @@
365+
"//tensorflow/core:core_cpu",
366+
"//tensorflow/core:lib",
367+
"//tensorflow/core:protos_all_cc",
368+
+ ]) + if_android([
369+
+ "//tensorflow/core:android_tensorflow_lib",
370+
]),
371+
)
372+
373+
@@ -115,6 +119,8 @@
374+
"//tensorflow/core:lib_internal",
375+
"//tensorflow/core:protos_all_cc",
376+
"//tensorflow/core/util/tensor_bundle:naming",
377+
+ ]) + if_android([
378+
+ "//tensorflow/core:android_tensorflow_lib",
379+
]),
380+
alwayslink = 1,
381+
)
382+
"""
383+
384+
353385
def write_tensorflow_android_absl_patch(path: Path) -> None:
354386
path.parent.mkdir(parents=True, exist_ok=True)
355387
absl_patch_text = (
@@ -371,6 +403,7 @@ def write_tensorflow_android_absl_patch(path: Path) -> None:
371403
text += EAGER_CONTEXT_ANDROID_DEPS_PATCH
372404
text += TF_C_API_EXPERIMENTAL_BUILD_PATCH
373405
text += TF_C_API_EXPERIMENTAL_CC_PATCH
406+
text += SAVED_MODEL_ANDROID_DEPS_PATCH
374407
if not text.endswith("\n"):
375408
text += "\n"
376409
path.write_text(text, encoding="utf-8")

0 commit comments

Comments
 (0)