Skip to content

Commit

Permalink
Fix for ICL-370, the root cause is we need to check the bottom blob i…
Browse files Browse the repository at this point in the history
…s prv or cpu firstly.
  • Loading branch information
guomingz committed Jan 8, 2018
1 parent f9ae217 commit 29eec8c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/caffe/layers/mkldnn_convolution_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,17 @@ void MKLDNNConvolutionLayer<Dtype>::InitConvolutionFwd(const vector<Blob<Dtype>*
bool is_sum;
if (bottom.size() > 1) {
is_sum = true;
shared_ptr<MKLDNNMemoryDescriptor<Dtype, false> > bottom_0_desc =
get_mkldnn_prv_descriptor<Dtype, false>(bottom[0]);

shared_ptr<MKLDNNMemoryDescriptor<Dtype, false> > bottom_1_desc =
get_mkldnn_prv_descriptor<Dtype, false>(bottom[1]);
memory::data_type bottom_1_dt = memory::data_type::f32;
if (const_cast<Dtype*>(bottom[1]->prv_data()) != NULL){

shared_ptr<MKLDNNMemoryDescriptor<Dtype, false> > bottom_1_desc =
get_mkldnn_prv_descriptor<Dtype, false>(bottom[1]);
bottom_1_dt = static_cast<memory::data_type>(bottom_1_desc->prv_memory_pd()->desc().data.data_type);
}

if (top_dt != bottom_1_desc->prv_memory_pd()->desc().data.data_type) {
top_dt = static_cast<memory::data_type>(
bottom_1_desc->prv_memory_pd()->desc().data.data_type);
if (top_dt != bottom_1_dt) {
top_dt = bottom_1_dt;
}
}

Expand Down

0 comments on commit 29eec8c

Please sign in to comment.