diff --git a/paddle/fluid/eager/CMakeLists.txt b/paddle/fluid/eager/CMakeLists.txt index 7d99a80eaeea879e912f88a0d55c6d072aab0d27..bd005fc41d42ec1baba278be0708758e012869ca 100644 --- a/paddle/fluid/eager/CMakeLists.txt +++ b/paddle/fluid/eager/CMakeLists.txt @@ -78,10 +78,10 @@ cc_library( autograd_meta hook_utils) -cc_library( - saved_tensors_hooks - SRCS saved_tensors_hooks.cc - DEPS hook_utils) if(NOT ((NOT WITH_PYTHON) AND ON_INFER)) + cc_library( + saved_tensors_hooks + SRCS saved_tensors_hooks.cc + DEPS hook_utils) add_subdirectory(tests) endif() diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index a1231d7f55322bdfaeac6e00e925a898967d2b5f..7e5bf07ea312563bdf8cbe41a099c5fd3099bd22 100755 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -41,8 +41,7 @@ set(PYBIND_DEPS new_profiler auto_parallel jit_layer - jit_property - saved_tensors_hooks) + jit_property) if(WITH_PSCORE) set(PYBIND_DEPS ${PYBIND_DEPS} ps_service) @@ -571,6 +570,7 @@ if(WITH_PYTHON) list(APPEND PYBIND_DEPS python) list(APPEND PYBIND_DEPS custom_operator) list(APPEND PYBIND_DEPS custom_operator_node) + list(APPEND PYBIND_DEPS saved_tensors_hooks) endif() cc_library(