Skip to content

Commit dd428a0

Browse files
authored
Merge pull request #10921 from reyoung/feature/change_optimizer_tests
Change optimizer to old paddle style
2 parents 36fd705 + c980e4c commit dd428a0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ endif(USE_NNPACK)
202202

203203
add_subdirectory(proto)
204204

205-
if(NOT MOBILE_INFERENCE)
205+
if(NOT MOBILE_INFERENCE AND NOT WITH_FLUID_ONLY)
206206
# "add_subdirectory(go)" should be placed after the following loine,
207207
# because it depends on paddle/optimizer.
208208
add_subdirectory(paddle/optimizer)

paddle/optimizer/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ set(OPITMIZER_SRCS
77
sgd_optimizer.cc
88
)
99

10-
cc_library(paddle_optimizer STATIC SRCS ${OPITMIZER_SRCS} DEPS paddle_proto glog)
11-
cc_test(serialization_test SRCS serialization_test.cc DEPS paddle_proto)
12-
cc_test(parameter_optimizer_test SRCS parameter_optimizer_test.cc DEPS paddle_optimizer)
10+
add_library(paddle_optimizer ${OPITMIZER_SRCS})
11+
target_link_libraries(paddle_optimizer paddle_proto glog)
12+
13+
if (WITH_TESTING)
14+
add_unittest(serialization_test serialization_test.cc)
15+
add_unittest(parameter_optimizer_test parameter_optimizer_test.cc)
16+
endif()

0 commit comments

Comments
 (0)