Skip to content

Commit

Permalink
Fix cudnn_deconv not guarding no_bias (apache#6456)
Browse files Browse the repository at this point in the history
  • Loading branch information
reminisce authored and piiswrong committed May 26, 2017
1 parent da07062 commit a6f263f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/operator/cudnn_deconvolution-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,19 @@ class CuDNNDeconvolutionOp : public Operator {
gdata_ptr = gdata.dptr_;
}
CHECK_NE(req[deconv::kWeight], kWriteInplace);
CHECK_NE(req[deconv::kBias], kWriteInplace);
if (!param_.no_bias) {
CHECK_NE(req[deconv::kBias], kWriteInplace);
}
CHECK_NE(req[deconv::kData], kWriteInplace);
Tensor<gpu, 1, DType> workspace =
ctx.requested[deconv::kTempSpace].get_space_typed<gpu, 1, DType>(
mshadow::Shape1(backward_workspace_), s);
for (uint32_t g = 0; g < param_.num_group; ++g) {
typename DataType<DType>::ScaleType alpha = 1.0f;
typename DataType<DType>::ScaleType bias_beta =
req[deconv::kBias] == kAddTo ? 1.0f : 0.0f;
typename DataType<DType>::ScaleType bias_beta = 0.0f;
if (!param_.no_bias && req[deconv::kBias] == kAddTo) {
bias_beta = 1.0f;
}
typename DataType<DType>::ScaleType data_beta =
req[deconv::kData] == kAddTo ? 1.0f : 0.0f;
typename DataType<DType>::ScaleType weight_beta =
Expand Down

0 comments on commit a6f263f

Please sign in to comment.