зеркало из https://github.com/microsoft/caffe.git
Merge pull request #1048 from jyegerlehner/conv_layer-init-weight
Conv layer: fix crash by setting weight pointer
This commit is contained in:
Коммит
5ab3d97609
|
@ -203,6 +203,9 @@ void ConvolutionLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
|
|||
}
|
||||
// gradient w.r.t. bottom data, if necessary
|
||||
if (propagate_down[i]) {
|
||||
if (weight == NULL) {
|
||||
weight = this->blobs_[0]->cpu_data();
|
||||
}
|
||||
for (int g = 0; g < group_; ++g) {
|
||||
caffe_cpu_gemm<Dtype>(CblasTrans, CblasNoTrans, K_, N_, M_,
|
||||
(Dtype)1., weight + weight_offset * g,
|
||||
|
|
|
@ -96,6 +96,9 @@ void ConvolutionLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
|
|||
}
|
||||
// gradient w.r.t. bottom data, if necessary
|
||||
if (propagate_down[i]) {
|
||||
if (weight == NULL) {
|
||||
weight = this->blobs_[0]->gpu_data();
|
||||
}
|
||||
for (int g = 0; g < group_; ++g) {
|
||||
caffe_gpu_gemm<Dtype>(CblasTrans, CblasNoTrans, K_, N_, M_,
|
||||
(Dtype)1., weight + weight_offset * g,
|
||||
|
|
Загрузка…
Ссылка в новой задаче