From 167933f678ccbb3563e949710279efe004a27731 Mon Sep 17 00:00:00 2001 From: chengduozh Date: Thu, 17 Jan 2019 17:38:48 +0800 Subject: [PATCH] set constant for loss test=develop --- paddle/fluid/operators/warpctc_cudnn_op.cu.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/fluid/operators/warpctc_cudnn_op.cu.cc b/paddle/fluid/operators/warpctc_cudnn_op.cu.cc index 2c0f9b89a8e..5e16a209e71 100644 --- a/paddle/fluid/operators/warpctc_cudnn_op.cu.cc +++ b/paddle/fluid/operators/warpctc_cudnn_op.cu.cc @@ -144,6 +144,8 @@ class CudnnCTCKernel : public framework::OpKernel { CUDNN_CTC_LOSS_ALGO_DETERMINISTIC, cu_ctcloss_desc, &workspace_size)); T* loss_data = loss->mutable_data(loss_dims, ctx.GetPlace()); + math::SetConstant()( + ctx.template device_context(), loss, static_cast(0)); auto temp_allocation = platform::DeviceTemporaryAllocator::Instance().Get(dev_ctx).Allocate( -- GitLab