Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix cudnn_deconv not checking no_bias #6456

Merged
merged 1 commit into from
May 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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