Skip to content

Commit 5f21709

Browse files
committed
Fix bug.
1 parent 524ccba commit 5f21709

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

paddle/operators/math/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if(WITH_GPU)
1010
nv_library(pooling SRCS pooling.cc pooling.cu DEPS device_context)
1111
nv_library(sequence_pooling SRCS sequence_pooling.cc sequence_pooling.cu DEPS device_context math_function)
1212
nv_library(vol2col SRCS vol2col.cc vol2col.cu DEPS device_context)
13-
nv_library(context_project SRCS context_project.cc context_project.cu DEPS device_context)
13+
nv_library(context_project SRCS context_project.cc context_project.cu DEPS device_context math_function)
1414
nv_library(sequence2batch SRCS sequence2batch.cc sequence2batch.cu DEPS device_context)
1515
nv_library(lstm_compute SRCS lstm_compute.cc lstm_compute.cu DEPS device_context activation_functions)
1616
nv_library(gru_compute SRCS gru_compute.cc gru_compute.cu DEPS device_context activation_functions math_function)
@@ -22,7 +22,7 @@ else()
2222
cc_library(pooling SRCS pooling.cc DEPS device_context)
2323
cc_library(sequence_pooling SRCS sequence_pooling.cc DEPS device_context math_function)
2424
cc_library(vol2col SRCS vol2col.cc DEPS device_context)
25-
cc_library(context_project SRCS context_project.cc DEPS device_context)
25+
cc_library(context_project SRCS context_project.cc DEPS device_context math_function)
2626
cc_library(sequence2batch SRCS sequence2batch.cc DEPS device_context)
2727
cc_library(lstm_compute SRCS lstm_compute.cc DEPS device_context activation_functions)
2828
cc_library(gru_compute SRCS gru_compute.cc DEPS device_context activation_functions math_function)

paddle/operators/math/context_project.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ class ContextProjectFunctor {
9191
auto lod_level_0 = in.lod()[0];
9292

9393
math::Im2ColFunctor<math::ColFormat::kOCF, Place, float> im2col_ocf;
94-
if (platform::is_gpu_place(context.GetPlace())) {
95-
LOG(INFO) << "========= gpu ==========";
96-
}
9794

9895
int input_row_begin, input_row_end;
9996
int sequence_height, sequence_width;

paddle/operators/math/math_function_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ template <typename Place, typename T>
2323
void SetConstant<Place, T>::operator()(const platform::DeviceContext& context,
2424
framework::Tensor* tensor, T num) {
2525
auto t = framework::EigenVector<T>::Flatten(*tensor);
26-
t.device(*context.GetEigenDevice<platform::CPUPlace>()) =
27-
t.constant(static_cast<T>(num));
26+
t.device(*context.GetEigenDevice<Place>()) = t.constant(static_cast<T>(num));
2827
}
2928

3029
template <typename Place, typename T, int Rank>

paddle/operators/softmax_op.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class SoftmaxKernel : public framework::OpKernel<T> {
2727
void Compute(const framework::ExecutionContext& context) const override {
2828
auto* X = context.Input<Tensor>("X");
2929
auto* Y = context.Output<Tensor>("Y");
30-
if (platform::is_gpu_place(context.GetPlace())) {
31-
LOG(INFO) << "==========gpu=========";
32-
}
3330

3431
// allocate memory on device.
3532
Y->mutable_data<T>(context.GetPlace());

0 commit comments

Comments
 (0)