From 28c049b89abe418efe896af015deb79ff0db4433 Mon Sep 17 00:00:00 2001 From: rensilin Date: Wed, 31 Jul 2019 17:02:52 +0800 Subject: [PATCH] add_pybind Change-Id: I37e5e5d21ac9f053294d65e90edebb439e55acc1 --- paddle/fluid/pybind/.gitignore | 1 - paddle/fluid/pybind/pybind.h | 553 ++++++++++++++++++ .../custom_trainer/feed/executor/executor.cc | 6 + .../fluid/train/custom_trainer/feed/main.cc | 1 + .../custom_trainer/feed/unit_test/main.cc | 3 +- .../feed/unit_test/test_executor.cc | 2 +- 6 files changed, 563 insertions(+), 3 deletions(-) delete mode 100644 paddle/fluid/pybind/.gitignore create mode 100644 paddle/fluid/pybind/pybind.h diff --git a/paddle/fluid/pybind/.gitignore b/paddle/fluid/pybind/.gitignore deleted file mode 100644 index 8f222791..00000000 --- a/paddle/fluid/pybind/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pybind.h diff --git a/paddle/fluid/pybind/pybind.h b/paddle/fluid/pybind/pybind.h new file mode 100644 index 00000000..40ed4ea0 --- /dev/null +++ b/paddle/fluid/pybind/pybind.h @@ -0,0 +1,553 @@ +#ifdef PYBIND_AVX_MKLML +// Generated by the paddle/fluid/operator/CMakeLists.txt. DO NOT EDIT! + +USE_NO_KERNEL_OP(feed); +USE_NO_KERNEL_OP(while); +USE_NO_KERNEL_OP(get_places); +USE_NO_KERNEL_OP(fetch); +USE_NO_KERNEL_OP(conditional_block_infer); +USE_NO_KERNEL_OP(conditional_block); +USE_OP(less_than); +USE_OP(logical_and); +USE_NO_KERNEL_OP(read_from_array); +USE_CPU_ONLY_OP(bipartite_match); +USE_OP(box_coder); +USE_OP(iou_similarity); +USE_CPU_ONLY_OP(mine_hard_examples); +USE_CPU_ONLY_OP(multiclass_nms); +USE_OP(prior_box); +USE_OP(density_prior_box); +USE_OP(anchor_generator); +USE_OP(target_assign); +USE_OP(polygon_box_transform); +USE_CPU_ONLY_OP(rpn_target_assign); +USE_CPU_ONLY_OP(generate_proposal_labels); +USE_OP(box_clip); +USE_CPU_ONLY_OP(yolov3_loss); +USE_OP(yolo_box); +USE_OP(box_decoder_and_assign); +USE_OP(sigmoid_focal_loss); +USE_CPU_ONLY_OP(retinanet_detection_output); +USE_CPU_ONLY_OP(generate_proposals); +USE_CPU_ONLY_OP(distribute_fpn_proposals); +USE_CPU_ONLY_OP(collect_fpn_proposals); +USE_OP(roi_perspective_transform); +USE_CPU_ONLY_OP(generate_mask_labels); +USE_OP(elementwise_mod); +USE_OP(elementwise_floordiv); +USE_OP(elementwise_max); +USE_OP(elementwise_pow); +USE_OP(elementwise_sub_grad); +USE_OP(elementwise_add_grad); +USE_OP(elementwise_min); +USE_OP(elementwise_div); +USE_OP(elementwise_mul); +USE_CPU_ONLY_OP(fusion_squared_mat_sub); +USE_CPU_ONLY_OP(fusion_seqpool_concat); +USE_CPU_ONLY_OP(fused_embedding_fc_lstm); +USE_CPU_ONLY_OP(fusion_seqexpand_concat_fc); +USE_CPU_ONLY_OP(fused_embedding_seq_pool); +USE_CPU_ONLY_OP(fusion_seqconv_eltadd_relu); +USE_CPU_ONLY_OP(fusion_gru); +USE_CPU_ONLY_OP(fusion_repeated_fc_relu); +USE_CPU_ONLY_OP(fusion_lstm); +USE_OP(fused_elemwise_activation); +USE_OP(accuracy); +USE_CPU_ONLY_OP(precision_recall); +USE_CPU_ONLY_OP(auc); +USE_OP(adamax); +USE_OP(sgd); +USE_OP(lars_momentum); +USE_OP(adagrad); +USE_OP(ftrl); +USE_OP(momentum); +USE_OP(adadelta); +USE_OP(rmsprop); +USE_OP(lamb); +USE_OP(proximal_gd); +USE_OP(proximal_adagrad); +USE_OP(adam); +USE_OP(decayed_adagrad); +USE_OP(reduce_all); +USE_OP(reduce_min); +USE_OP(reduce_sum); +USE_OP(reduce_any); +USE_OP(reduce_max); +USE_OP(reduce_mean); +USE_OP(reduce_prod); +USE_OP(sequence_erase); +USE_OP(sequence_unpad); +USE_OP(sequence_mask); +USE_OP(sequence_expand); +USE_OP(sequence_pad); +USE_OP(sequence_enumerate); +USE_OP(sequence_slice); +USE_OP(sequence_softmax); +USE_OP(sequence_expand_as); +USE_OP(sequence_pool); +USE_OP(sequence_reverse); +USE_CPU_ONLY_OP(sequence_scatter); +USE_OP(sequence_conv); +USE_OP(sequence_concat); +USE_OP(sequence_reshape); +USE_NO_KERNEL_OP(open_files); +USE_NO_KERNEL_OP(create_random_data_generator); +USE_NO_KERNEL_OP(create_shuffle_reader); +USE_NO_KERNEL_OP(create_batch_reader); +USE_NO_KERNEL_OP(create_recordio_file_reader); +USE_NO_KERNEL_OP(create_double_buffer_reader); +USE_NO_KERNEL_OP(create_multi_pass_reader); +USE_NO_KERNEL_OP(create_custom_reader); +USE_NO_KERNEL_OP(create_py_reader); +USE_NO_KERNEL_OP(read); +USE_OP(increment); +USE_OP(stack); +USE_CPU_ONLY_OP(fc); +USE_NO_KERNEL_OP(assign); +USE_OP(load); +USE_NO_KERNEL_OP(fill); +USE_NO_KERNEL_OP(reorder_lod_tensor_by_rank); +USE_OP(conv_shift); +USE_OP(fill_zeros_like); +USE_CPU_ONLY_OP(hash); +USE_NO_KERNEL_OP(dequantize); +USE_OP(fake_quantize_abs_max); +USE_OP(size); +USE_OP(scatter); +USE_OP(uniform_random); +USE_OP(beam_search); +USE_NO_KERNEL_OP(beam_search_decode); +USE_OP(dropout); +USE_OP(bilinear_interp); +USE_OP(sampling_id); +USE_OP(lstm); +USE_OP(modified_huber_loss); +USE_OP(temporal_shift); +USE_OP(sum); +USE_OP(arg_min); +USE_OP(psroi_pool); +USE_NO_KERNEL_OP(uniform_random_batch_size_like); +USE_NO_KERNEL_OP(rnn_memory_helper); +USE_CPU_ONLY_OP(crf_decoding); +USE_OP(where); +USE_OP(fake_dequantize_max_abs); +USE_OP(mean_iou); +USE_OP(roi_align); +USE_OP(range); +USE_OP(edit_distance); +USE_OP(multiplex); +USE_OP(clip); +USE_OP(gaussian_random); +USE_OP(norm); +USE_OP(rank_loss); +USE_CPU_ONLY_OP(detection_map); +USE_OP(lstm_unit); +USE_OP(shard_index); +USE_OP(shape); +USE_OP(arg_max); +USE_OP(average_accumulates); +USE_NO_KERNEL_OP(requantize); +USE_OP(conv2d); +USE_CPU_ONLY_OP(add_position_encoding); +USE_OP(gru_unit); +USE_OP(batch_norm); +USE_CPU_ONLY_OP(chunk_eval); +USE_NO_KERNEL_OP(lod_rank_table); +USE_NO_KERNEL_OP(unsqueeze); +USE_CPU_ONLY_OP(positive_negative_pair); +USE_OP(im2sequence); +USE_OP(margin_rank_loss); +USE_OP(hinge_loss); +USE_CPU_ONLY_OP(cvm); +USE_OP(huber_loss); +USE_OP(crop); +USE_OP(relu_grad); +USE_CPU_ONLY_OP(hierarchical_sigmoid); +USE_OP(unfold); +USE_NO_KERNEL_OP(max_sequence_len); +USE_OP(mul); +USE_CPU_ONLY_OP(attention_lstm); +USE_OP(top_k); +USE_OP(group_norm); +USE_OP(selu); +USE_OP(lstmp); +USE_NO_KERNEL_OP(merge_lod_tensor); +USE_OP(truncated_gaussian_random); +USE_OP(label_smooth); +USE_CPU_ONLY_OP(matmul); +USE_OP(spp); +USE_NO_KERNEL_OP(unstack); +USE_OP(conv2d_transpose); +USE_OP(diag); +USE_OP(unpool); +USE_NO_KERNEL_OP(lod_array_length); +USE_OP(affine_channel); +USE_OP(log_loss); +USE_OP(concat); +USE_NO_KERNEL_OP(lod_tensor_to_array); +USE_OP(gru); +USE_CPU_ONLY_OP(coalesce_tensor); +USE_OP(fsp); +USE_OP(linspace); +USE_OP(reverse); +USE_NO_KERNEL_OP(recurrent); +USE_OP(split_selected_rows); +USE_OP(dgc_clip_by_norm); +USE_OP(scale); +USE_OP(save); +USE_OP(load_combine); +USE_OP(merge_selected_rows); +USE_OP(split); +USE_OP(cumsum); +USE_OP(deformable_psroi_pooling); +USE_CPU_ONLY_OP(teacher_student_sigmoid_loss); +USE_OP(transpose); +USE_OP(fill_constant_batch_size_like); +USE_OP(sigmoid_cross_entropy_with_logits); +USE_OP(shuffle_channel); +USE_CPU_ONLY_OP(affine_grid); +USE_NO_KERNEL_OP(split_lod_tensor); +USE_CPU_ONLY_OP(grid_sampler); +USE_OP(lookup_table); +USE_OP(cos_sim); +USE_NO_KERNEL_OP(quantize); +USE_OP(spectral_norm); +USE_OP(cross_entropy); +USE_NO_KERNEL_OP(print); +USE_OP(lrn); +USE_CPU_ONLY_OP(nce); +USE_CPU_ONLY_OP(similarity_focus); +USE_CPU_ONLY_OP(get_tensor_from_selected_rows); +USE_OP(squared_l2_distance); +USE_OP(cudnn_lstm); +USE_OP(tree_conv); +USE_OP(one_hot); +USE_NO_KERNEL_OP(lookup_sparse_table); +USE_CPU_ONLY_OP(unique); +USE_OP(mean); +USE_OP(prelu); +USE_NO_KERNEL_OP(delete_var); +USE_OP(ctc_align); +USE_OP(argsort); +USE_CPU_ONLY_OP(data_norm); +USE_OP(minus); +USE_NO_KERNEL_OP(shrink_rnn_memory); +USE_OP(lod_reset); +USE_OP(l1_norm); +USE_NO_KERNEL_OP(gaussian_random_batch_size_like); +USE_OP(is_empty); +USE_OP(bilinear_tensor_product); +USE_OP(kldiv_loss); +USE_NO_KERNEL_OP(squeeze); +USE_OP(softmax); +USE_OP(clip_by_norm); +USE_OP(max_pool2d_with_index); +USE_OP(linear_chain_crf); +USE_CPU_ONLY_OP(reshape); +USE_OP(fill_constant); +USE_OP(space_to_depth); +USE_OP(gather); +USE_OP(softmax_with_cross_entropy); +USE_OP(slice); +USE_OP(sign); +USE_OP(expand); +USE_OP(smooth_l1_loss); +USE_NO_KERNEL_OP(tensor_array_to_tensor); +USE_OP(row_conv); +USE_OP(pad2d); +USE_OP(pixel_shuffle); +USE_OP(assign_value); +USE_OP(random_crop); +USE_OP(squared_l2_norm); +USE_OP(save_combine); +USE_OP(pool2d); +USE_OP(cast); +USE_NO_KERNEL_OP(array_to_lod_tensor); +USE_OP(fill_any_like); +USE_NO_KERNEL_OP(flatten); +USE_OP(sample_logits); +USE_OP(pad); +USE_CPU_ONLY_OP(bpr_loss); +USE_OP(roi_pool); +USE_OP(pad_constant_like); +USE_OP(isfinite); +USE_OP(layer_norm); +USE_OP(maxout); +USE_OP(warpctc); +#elif defined PYBIND_NOAVX_OPENBLAS +// Generated by the paddle/fluid/operator/CMakeLists.txt. DO NOT EDIT! + +USE_NO_KERNEL_OP(feed); +USE_NO_KERNEL_OP(while); +USE_NO_KERNEL_OP(get_places); +USE_NO_KERNEL_OP(fetch); +USE_NO_KERNEL_OP(conditional_block_infer); +USE_NO_KERNEL_OP(conditional_block); +USE_OP(less_than); +USE_OP(logical_and); +USE_NO_KERNEL_OP(read_from_array); +USE_CPU_ONLY_OP(bipartite_match); +USE_OP(box_coder); +USE_OP(iou_similarity); +USE_CPU_ONLY_OP(mine_hard_examples); +USE_CPU_ONLY_OP(multiclass_nms); +USE_OP(prior_box); +USE_OP(density_prior_box); +USE_OP(anchor_generator); +USE_OP(target_assign); +USE_OP(polygon_box_transform); +USE_CPU_ONLY_OP(rpn_target_assign); +USE_CPU_ONLY_OP(generate_proposal_labels); +USE_OP(box_clip); +USE_CPU_ONLY_OP(yolov3_loss); +USE_OP(yolo_box); +USE_OP(box_decoder_and_assign); +USE_OP(sigmoid_focal_loss); +USE_CPU_ONLY_OP(retinanet_detection_output); +USE_CPU_ONLY_OP(generate_proposals); +USE_CPU_ONLY_OP(distribute_fpn_proposals); +USE_CPU_ONLY_OP(collect_fpn_proposals); +USE_OP(roi_perspective_transform); +USE_CPU_ONLY_OP(generate_mask_labels); +USE_OP(elementwise_mod); +USE_OP(elementwise_floordiv); +USE_OP(elementwise_max); +USE_OP(elementwise_pow); +USE_OP(elementwise_sub_grad); +USE_OP(elementwise_add_grad); +USE_OP(elementwise_min); +USE_OP(elementwise_div); +USE_OP(elementwise_mul); +USE_CPU_ONLY_OP(fusion_squared_mat_sub); +USE_CPU_ONLY_OP(fusion_seqpool_concat); +USE_CPU_ONLY_OP(fused_embedding_fc_lstm); +USE_CPU_ONLY_OP(fusion_seqexpand_concat_fc); +USE_CPU_ONLY_OP(fused_embedding_seq_pool); +USE_CPU_ONLY_OP(fusion_seqconv_eltadd_relu); +USE_CPU_ONLY_OP(fusion_gru); +USE_CPU_ONLY_OP(fusion_repeated_fc_relu); +USE_CPU_ONLY_OP(fusion_lstm); +USE_OP(fused_elemwise_activation); +USE_OP(accuracy); +USE_CPU_ONLY_OP(precision_recall); +USE_CPU_ONLY_OP(auc); +USE_OP(adamax); +USE_OP(sgd); +USE_OP(lars_momentum); +USE_OP(adagrad); +USE_OP(ftrl); +USE_OP(momentum); +USE_OP(adadelta); +USE_OP(rmsprop); +USE_OP(lamb); +USE_OP(proximal_gd); +USE_OP(proximal_adagrad); +USE_OP(adam); +USE_OP(decayed_adagrad); +USE_OP(reduce_all); +USE_OP(reduce_min); +USE_OP(reduce_sum); +USE_OP(reduce_any); +USE_OP(reduce_max); +USE_OP(reduce_mean); +USE_OP(reduce_prod); +USE_OP(sequence_erase); +USE_OP(sequence_unpad); +USE_OP(sequence_mask); +USE_OP(sequence_expand); +USE_OP(sequence_pad); +USE_OP(sequence_enumerate); +USE_OP(sequence_slice); +USE_OP(sequence_softmax); +USE_OP(sequence_expand_as); +USE_OP(sequence_pool); +USE_OP(sequence_reverse); +USE_CPU_ONLY_OP(sequence_scatter); +USE_OP(sequence_conv); +USE_OP(sequence_concat); +USE_OP(sequence_reshape); +USE_NO_KERNEL_OP(open_files); +USE_NO_KERNEL_OP(create_random_data_generator); +USE_NO_KERNEL_OP(create_shuffle_reader); +USE_NO_KERNEL_OP(create_batch_reader); +USE_NO_KERNEL_OP(create_recordio_file_reader); +USE_NO_KERNEL_OP(create_double_buffer_reader); +USE_NO_KERNEL_OP(create_multi_pass_reader); +USE_NO_KERNEL_OP(create_custom_reader); +USE_NO_KERNEL_OP(create_py_reader); +USE_NO_KERNEL_OP(read); +USE_OP(increment); +USE_OP(stack); +USE_CPU_ONLY_OP(fc); +USE_NO_KERNEL_OP(assign); +USE_OP(load); +USE_NO_KERNEL_OP(fill); +USE_NO_KERNEL_OP(reorder_lod_tensor_by_rank); +USE_OP(conv_shift); +USE_OP(fill_zeros_like); +USE_CPU_ONLY_OP(hash); +USE_NO_KERNEL_OP(dequantize); +USE_OP(fake_quantize_abs_max); +USE_OP(size); +USE_OP(scatter); +USE_OP(uniform_random); +USE_OP(beam_search); +USE_NO_KERNEL_OP(beam_search_decode); +USE_OP(dropout); +USE_OP(bilinear_interp); +USE_OP(sampling_id); +USE_OP(lstm); +USE_OP(modified_huber_loss); +USE_OP(temporal_shift); +USE_OP(sum); +USE_OP(arg_min); +USE_OP(psroi_pool); +USE_NO_KERNEL_OP(uniform_random_batch_size_like); +USE_NO_KERNEL_OP(rnn_memory_helper); +USE_CPU_ONLY_OP(crf_decoding); +USE_OP(where); +USE_OP(fake_dequantize_max_abs); +USE_OP(mean_iou); +USE_OP(roi_align); +USE_OP(range); +USE_OP(edit_distance); +USE_OP(multiplex); +USE_OP(clip); +USE_OP(gaussian_random); +USE_OP(norm); +USE_OP(rank_loss); +USE_CPU_ONLY_OP(detection_map); +USE_OP(lstm_unit); +USE_OP(shard_index); +USE_OP(shape); +USE_OP(arg_max); +USE_OP(average_accumulates); +USE_NO_KERNEL_OP(requantize); +USE_OP(conv2d); +USE_CPU_ONLY_OP(add_position_encoding); +USE_OP(gru_unit); +USE_OP(batch_norm); +USE_CPU_ONLY_OP(chunk_eval); +USE_NO_KERNEL_OP(lod_rank_table); +USE_NO_KERNEL_OP(unsqueeze); +USE_CPU_ONLY_OP(positive_negative_pair); +USE_OP(im2sequence); +USE_OP(margin_rank_loss); +USE_OP(hinge_loss); +USE_CPU_ONLY_OP(cvm); +USE_OP(huber_loss); +USE_OP(crop); +USE_OP(relu_grad); +USE_CPU_ONLY_OP(hierarchical_sigmoid); +USE_OP(unfold); +USE_NO_KERNEL_OP(max_sequence_len); +USE_OP(mul); +USE_CPU_ONLY_OP(attention_lstm); +USE_OP(top_k); +USE_OP(group_norm); +USE_OP(selu); +USE_OP(lstmp); +USE_NO_KERNEL_OP(merge_lod_tensor); +USE_OP(truncated_gaussian_random); +USE_OP(label_smooth); +USE_CPU_ONLY_OP(matmul); +USE_OP(spp); +USE_NO_KERNEL_OP(unstack); +USE_OP(conv2d_transpose); +USE_OP(diag); +USE_OP(unpool); +USE_NO_KERNEL_OP(lod_array_length); +USE_OP(affine_channel); +USE_OP(log_loss); +USE_OP(concat); +USE_NO_KERNEL_OP(lod_tensor_to_array); +USE_OP(gru); +USE_CPU_ONLY_OP(coalesce_tensor); +USE_OP(fsp); +USE_OP(linspace); +USE_OP(reverse); +USE_NO_KERNEL_OP(recurrent); +USE_OP(split_selected_rows); +USE_OP(dgc_clip_by_norm); +USE_OP(scale); +USE_OP(save); +USE_OP(load_combine); +USE_OP(merge_selected_rows); +USE_OP(split); +USE_OP(cumsum); +USE_OP(deformable_psroi_pooling); +USE_CPU_ONLY_OP(teacher_student_sigmoid_loss); +USE_OP(transpose); +USE_OP(fill_constant_batch_size_like); +USE_OP(sigmoid_cross_entropy_with_logits); +USE_OP(shuffle_channel); +USE_CPU_ONLY_OP(affine_grid); +USE_NO_KERNEL_OP(split_lod_tensor); +USE_CPU_ONLY_OP(grid_sampler); +USE_OP(lookup_table); +USE_OP(cos_sim); +USE_NO_KERNEL_OP(quantize); +USE_OP(spectral_norm); +USE_OP(cross_entropy); +USE_NO_KERNEL_OP(print); +USE_OP(lrn); +USE_CPU_ONLY_OP(nce); +USE_CPU_ONLY_OP(similarity_focus); +USE_CPU_ONLY_OP(get_tensor_from_selected_rows); +USE_OP(squared_l2_distance); +USE_OP(cudnn_lstm); +USE_OP(tree_conv); +USE_OP(one_hot); +USE_NO_KERNEL_OP(lookup_sparse_table); +USE_CPU_ONLY_OP(unique); +USE_OP(mean); +USE_OP(prelu); +USE_NO_KERNEL_OP(delete_var); +USE_OP(ctc_align); +USE_OP(argsort); +USE_CPU_ONLY_OP(data_norm); +USE_OP(minus); +USE_NO_KERNEL_OP(shrink_rnn_memory); +USE_OP(lod_reset); +USE_OP(l1_norm); +USE_NO_KERNEL_OP(gaussian_random_batch_size_like); +USE_OP(is_empty); +USE_OP(bilinear_tensor_product); +USE_OP(kldiv_loss); +USE_NO_KERNEL_OP(squeeze); +USE_OP(softmax); +USE_OP(clip_by_norm); +USE_OP(max_pool2d_with_index); +USE_OP(linear_chain_crf); +USE_CPU_ONLY_OP(reshape); +USE_OP(fill_constant); +USE_OP(space_to_depth); +USE_OP(gather); +USE_OP(softmax_with_cross_entropy); +USE_OP(slice); +USE_OP(sign); +USE_OP(expand); +USE_OP(smooth_l1_loss); +USE_NO_KERNEL_OP(tensor_array_to_tensor); +USE_OP(row_conv); +USE_OP(pad2d); +USE_OP(pixel_shuffle); +USE_OP(assign_value); +USE_OP(random_crop); +USE_OP(squared_l2_norm); +USE_OP(save_combine); +USE_OP(pool2d); +USE_OP(cast); +USE_NO_KERNEL_OP(array_to_lod_tensor); +USE_OP(fill_any_like); +USE_NO_KERNEL_OP(flatten); +USE_OP(sample_logits); +USE_OP(pad); +USE_CPU_ONLY_OP(bpr_loss); +USE_OP(roi_pool); +USE_OP(pad_constant_like); +USE_OP(isfinite); +USE_OP(layer_norm); +USE_OP(maxout); +USE_OP(warpctc); +#endif diff --git a/paddle/fluid/train/custom_trainer/feed/executor/executor.cc b/paddle/fluid/train/custom_trainer/feed/executor/executor.cc index 38a29f92..b0d9a021 100644 --- a/paddle/fluid/train/custom_trainer/feed/executor/executor.cc +++ b/paddle/fluid/train/custom_trainer/feed/executor/executor.cc @@ -71,6 +71,12 @@ int SimpleExecute::initialize(YAML::Node& exe_config, paddle::platform::SetNumThreads(1); } + if (!exe_config["startup_program"] || + !exe_config["main_program"]) { + VLOG(4) << "fail to load config"; + return -1; + } + _context.reset(new SimpleExecute::Context(context_ptr->cpu_place)); auto startup_program = Load(&_context->executor, exe_config["startup_program"].as()); if (startup_program == nullptr) { diff --git a/paddle/fluid/train/custom_trainer/feed/main.cc b/paddle/fluid/train/custom_trainer/feed/main.cc index 833cd650..51784119 100644 --- a/paddle/fluid/train/custom_trainer/feed/main.cc +++ b/paddle/fluid/train/custom_trainer/feed/main.cc @@ -5,6 +5,7 @@ #include "paddle/fluid/train/custom_trainer/feed/trainer_context.h" #include "paddle/fluid/train/custom_trainer/feed/process/process.h" #include "paddle/fluid/train/custom_trainer/feed/process/init_env_process.h" +#include "paddle/fluid/pybind/pybind.h" using namespace paddle::custom_trainer::feed; diff --git a/paddle/fluid/train/custom_trainer/feed/unit_test/main.cc b/paddle/fluid/train/custom_trainer/feed/unit_test/main.cc index 0beaa70c..512189ba 100644 --- a/paddle/fluid/train/custom_trainer/feed/unit_test/main.cc +++ b/paddle/fluid/train/custom_trainer/feed/unit_test/main.cc @@ -1,10 +1,11 @@ #include #include #include +#include "paddle/fluid/pybind/pybind.h" int32_t main(int32_t argc, char** argv) { + ::google::InitGoogleLogging(argv[0]); ::testing::InitGoogleTest(&argc, argv); ::google::ParseCommandLineFlags(&argc, &argv, true); - google::InitGoogleLogging("paddle_trainer"); return RUN_ALL_TESTS(); } diff --git a/paddle/fluid/train/custom_trainer/feed/unit_test/test_executor.cc b/paddle/fluid/train/custom_trainer/feed/unit_test/test_executor.cc index bb5963e8..eac7d286 100644 --- a/paddle/fluid/train/custom_trainer/feed/unit_test/test_executor.cc +++ b/paddle/fluid/train/custom_trainer/feed/unit_test/test_executor.cc @@ -23,7 +23,7 @@ namespace feed { TEST(testSimpleExecute, initialize) { SimpleExecute execute; auto context_ptr = std::make_shared(); - auto config = YAML::Load("[1, 2, 3]"); + YAML::Node config = YAML::Load("[1, 2, 3]"); ASSERT_NE(0, execute.initialize(config, context_ptr)); config = YAML::Load("{startup_program: ./data/startup_program, main_program: ./data/main_program}"); ASSERT_EQ(0, execute.initialize(config, context_ptr)); -- GitLab