diff --git a/paddle/fluid/train/CMakeLists.txt b/paddle/fluid/train/CMakeLists.txt index 9f10f73637c68a413479c3e79a8ed12ca7ada49b..6cd9cbe379874e5ab7e40c1349e0483ff45bb63a 100644 --- a/paddle/fluid/train/CMakeLists.txt +++ b/paddle/fluid/train/CMakeLists.txt @@ -25,4 +25,6 @@ function(train_test TARGET_NAME) endfunction(train_test) -train_test(recognize_digits ARGS mlp conv) +if(WITH_TESTING) + train_test(recognize_digits ARGS mlp conv) +endif() diff --git a/paddle/fluid/train/test_train_recognize_digits.cc b/paddle/fluid/train/test_train_recognize_digits.cc index 45997985ea88bff959a5cda8a30af5c3d640630d..e8731dd51ad698e53b7f10cc781c52134f2d17a8 100644 --- a/paddle/fluid/train/test_train_recognize_digits.cc +++ b/paddle/fluid/train/test_train_recognize_digits.cc @@ -52,8 +52,6 @@ void Train() { PADDLE_ENFORCE_NE(loss_name, "", "loss not found"); - // init all parameters - // prepare data auto x_var = scope.Var("img"); auto x_tensor = x_var->GetMutable();