Skip to content

Commit

Permalink
delete print codes
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLim-sy committed May 24, 2021
1 parent 9d5db8d commit 259ecb2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions paddle/fluid/operators/controlflow/compare_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ template <typename DeviceContext, typename Functor>
class CompareOpCudaKernel
: public framework::OpKernel<typename Functor::ELEMENT_TYPE> {
public:
using InT = typename Functor::ELEMENT_TYPE;
using OutT = bool;
public:
using T = typename Functor::ELEMENT_TYPE;
void Compute(const framework::ExecutionContext& ctx) const override {
auto* x = ctx.Input<framework::Tensor>("X");
auto* y = ctx.Input<framework::Tensor>("Y");
auto* z = ctx.Output<framework::Tensor>("Out");
z->mutable_data<OutT>(ctx.GetPlace());

auto* x = ctx.Input<framework::LoDTensor>("X");
auto* y = ctx.Input<framework::LoDTensor>("Y");
auto* z = ctx.Output<framework::LoDTensor>("Out");
z->mutable_data<T>(ctx.GetPlace());
int axis = ctx.Attr<int>("axis");
axis = axis == -1 ? std::abs(x->dims().size() - y->dims().size()) : axis;
auto functor = Functor();
Expand All @@ -77,7 +76,7 @@ class CompareOpCudaKernel
const auto& cuda_ctx =
ctx.template device_context<platform::CUDADeviceContext>();

LaunchElementwiseCudaKernel<ElementwiseType::kBinary, InT, OutT>(
LaunchElementwiseCudaKernel<ElementwiseType::kBinary, T, bool>(
cuda_ctx, ins, &outs, axis, functor);
}
};
Expand Down

0 comments on commit 259ecb2

Please sign in to comment.