From 5f217099384be95e96a933200e6ed9f5bf1a38fe Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Sat, 11 Nov 2017 21:29:56 +0800 Subject: [PATCH] Fix bug. --- paddle/operators/math/CMakeLists.txt | 4 ++-- paddle/operators/math/context_project.h | 3 --- paddle/operators/math/math_function_impl.h | 3 +-- paddle/operators/softmax_op.h | 3 --- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/paddle/operators/math/CMakeLists.txt b/paddle/operators/math/CMakeLists.txt index ab7f23f57..c196724e4 100644 --- a/paddle/operators/math/CMakeLists.txt +++ b/paddle/operators/math/CMakeLists.txt @@ -10,7 +10,7 @@ if(WITH_GPU) nv_library(pooling SRCS pooling.cc pooling.cu DEPS device_context) nv_library(sequence_pooling SRCS sequence_pooling.cc sequence_pooling.cu DEPS device_context math_function) nv_library(vol2col SRCS vol2col.cc vol2col.cu DEPS device_context) - nv_library(context_project SRCS context_project.cc context_project.cu DEPS device_context) + nv_library(context_project SRCS context_project.cc context_project.cu DEPS device_context math_function) nv_library(sequence2batch SRCS sequence2batch.cc sequence2batch.cu DEPS device_context) nv_library(lstm_compute SRCS lstm_compute.cc lstm_compute.cu DEPS device_context activation_functions) nv_library(gru_compute SRCS gru_compute.cc gru_compute.cu DEPS device_context activation_functions math_function) @@ -22,7 +22,7 @@ else() cc_library(pooling SRCS pooling.cc DEPS device_context) cc_library(sequence_pooling SRCS sequence_pooling.cc DEPS device_context math_function) cc_library(vol2col SRCS vol2col.cc DEPS device_context) - cc_library(context_project SRCS context_project.cc DEPS device_context) + cc_library(context_project SRCS context_project.cc DEPS device_context math_function) cc_library(sequence2batch SRCS sequence2batch.cc DEPS device_context) cc_library(lstm_compute SRCS lstm_compute.cc DEPS device_context activation_functions) cc_library(gru_compute SRCS gru_compute.cc DEPS device_context activation_functions math_function) diff --git a/paddle/operators/math/context_project.h b/paddle/operators/math/context_project.h index 7dc76d0c6..563024dac 100644 --- a/paddle/operators/math/context_project.h +++ b/paddle/operators/math/context_project.h @@ -91,9 +91,6 @@ class ContextProjectFunctor { auto lod_level_0 = in.lod()[0]; math::Im2ColFunctor im2col_ocf; - if (platform::is_gpu_place(context.GetPlace())) { - LOG(INFO) << "========= gpu =========="; - } int input_row_begin, input_row_end; int sequence_height, sequence_width; diff --git a/paddle/operators/math/math_function_impl.h b/paddle/operators/math/math_function_impl.h index dd279cbbf..daa28f26d 100644 --- a/paddle/operators/math/math_function_impl.h +++ b/paddle/operators/math/math_function_impl.h @@ -23,8 +23,7 @@ template void SetConstant::operator()(const platform::DeviceContext& context, framework::Tensor* tensor, T num) { auto t = framework::EigenVector::Flatten(*tensor); - t.device(*context.GetEigenDevice()) = - t.constant(static_cast(num)); + t.device(*context.GetEigenDevice()) = t.constant(static_cast(num)); } template diff --git a/paddle/operators/softmax_op.h b/paddle/operators/softmax_op.h index 8e33a70e0..44d1e63f1 100644 --- a/paddle/operators/softmax_op.h +++ b/paddle/operators/softmax_op.h @@ -27,9 +27,6 @@ class SoftmaxKernel : public framework::OpKernel { void Compute(const framework::ExecutionContext& context) const override { auto* X = context.Input("X"); auto* Y = context.Output("Y"); - if (platform::is_gpu_place(context.GetPlace())) { - LOG(INFO) << "==========gpu========="; - } // allocate memory on device. Y->mutable_data(context.GetPlace()); -- GitLab