Skip to content

Commit 2761374

Browse files
authored
Merge pull request NVIDIA#201 from drnikolaev/caffe-0.15-reshape-fix
Reshape algorithm fixed
2 parents 5fefd4a + d5d7b75 commit 2761374

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/caffe/layers/cudnn_conv_layer.cpp

+6-13
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ bool CuDNNConvolutionLayer<Dtype>::IsBottomDescChanged(
383383
int cached_stride_n; int cached_stride_c;
384384
int cached_stride_h; int cached_stride_w;
385385
int n; int c; int h; int w;
386-
int stride_n; int stride_c;
387-
int stride_h; int stride_w;
388386
cudnnDataType_t type;
389387

390388
for (int i = 0; i < bottom.size(); i++) {
@@ -394,21 +392,16 @@ bool CuDNNConvolutionLayer<Dtype>::IsBottomDescChanged(
394392
&cached_n, &cached_c, &cached_h, &cached_w,
395393
&cached_stride_n, &cached_stride_c,
396394
&cached_stride_h, &cached_stride_w));
397-
CUDNN_CHECK(cudnnGetTensor4dDescriptor(
398-
bottom_descs_[i],
399-
&type,
400-
&n, &c, &h, &w,
401-
&stride_n, &stride_c,
402-
&stride_h, &stride_w));
395+
const vector<int>& shape = bottom[i]->shape();
396+
n = shape[0];
397+
c = shape[1];
398+
h = shape[2];
399+
w = shape[3];
403400

404401
if ((cached_n != n) ||
405402
(cached_c != c) ||
406403
(cached_h != h) ||
407-
(cached_w != w) ||
408-
(cached_stride_n != stride_n) ||
409-
(cached_stride_c != stride_c) ||
410-
(cached_stride_h != stride_h) ||
411-
(cached_stride_w != stride_w)) {
404+
(cached_w != w)) {
412405
return true;
413406
}
414407
}

0 commit comments

Comments
 (0)