@@ -32,7 +32,7 @@ TEST(inference, fit_a_line) {
3232 // The input data should be >= 0
3333 int64_t batch_size = 10 ;
3434 SetupTensor<float >(
35- input, {batch_size, 13 }, static_cast <float >(0 ), static_cast <float >(10 ));
35+ & input, {batch_size, 13 }, static_cast <float >(0 ), static_cast <float >(10 ));
3636 std::vector<paddle::framework::LoDTensor*> cpu_feeds;
3737 cpu_feeds.push_back (&input);
3838
@@ -51,7 +51,7 @@ TEST(inference, fit_a_line) {
5151 cpu_fetchs2.push_back (&output2);
5252
5353 // Run inference on CUDA GPU
54- LOG (INFO) << " --- CPU Runs: ---" ;
54+ LOG (INFO) << " --- GPU Runs: ---" ;
5555 TestInference<paddle::platform::CUDAPlace>(dirname, cpu_feeds, cpu_fetchs2);
5656 LOG (INFO) << output2.dims ();
5757
@@ -79,10 +79,8 @@ TEST(multi_thread_inference, fit_a_line) {
7979 // The second dim of the input tensor should be 13
8080 // The input data should be >= 0
8181 int64_t batch_size = 10 ;
82- SetupTensor<float >(*input,
83- {batch_size, 13 },
84- static_cast <float >(0 ),
85- static_cast <float >(10 ));
82+ SetupTensor<float >(
83+ input, {batch_size, 13 }, static_cast <float >(0 ), static_cast <float >(10 ));
8684 cpu_feeds[i].push_back (input);
8785 }
8886
@@ -112,6 +110,7 @@ TEST(multi_thread_inference, fit_a_line) {
112110 dirname, cpu_feeds, cpu_fetchs2, num_threads);
113111
114112 for (int i = 0 ; i < num_threads; ++i) {
113+ CheckError<float >(*cpu_fetchs1[i][0 ], *cpu_fetchs2[i][0 ]);
115114 delete cpu_fetchs2[i][0 ];
116115 }
117116#endif
0 commit comments