From d93279c70458c974d1b4b2cb965e85c35db848f1 Mon Sep 17 00:00:00 2001 From: Alexandre Benoit Date: Thu, 12 Nov 2015 11:05:45 +0100 Subject: [PATCH 1/2] removed 4dimensions constraints on blob shape --- include/caffe/blob.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/caffe/blob.hpp b/include/caffe/blob.hpp index af360ac24bd..1289e9e320a 100644 --- a/include/caffe/blob.hpp +++ b/include/caffe/blob.hpp @@ -137,12 +137,9 @@ class Blob { /// @brief Deprecated legacy shape accessor width: use shape(3) instead. inline int width() const { return LegacyShape(3); } inline int LegacyShape(int index) const { - CHECK_LE(num_axes(), 4) - << "Cannot use legacy accessors on Blobs with > 4 axes."; - CHECK_LT(index, 4); - CHECK_GE(index, -4); if (index >= num_axes() || index < -num_axes()) { - // Axis is out of range, but still in [0, 3] (or [-4, -1] for reverse + // Assuming num_axes is the blob dimension (generaly 4), + // axis is out of range, but still in [0, num_axes[ (or [-num_axes, -1] for reverse // indexing) -- this special case simulates the one-padding used to fill // extraneous axes of legacy blobs. return 1; From 8d11ea9fdb62105c4728d6a9cbb4e73e053a85aa Mon Sep 17 00:00:00 2001 From: Alexandre Benoit Date: Thu, 12 Nov 2015 16:44:38 +0100 Subject: [PATCH 2/2] removed 4dimensions constraints on blob shape --- include/caffe/blob.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/caffe/blob.hpp b/include/caffe/blob.hpp index 1289e9e320a..66c6aaf27f1 100644 --- a/include/caffe/blob.hpp +++ b/include/caffe/blob.hpp @@ -139,7 +139,8 @@ class Blob { inline int LegacyShape(int index) const { if (index >= num_axes() || index < -num_axes()) { // Assuming num_axes is the blob dimension (generaly 4), - // axis is out of range, but still in [0, num_axes[ (or [-num_axes, -1] for reverse + // axis is out of range, but still in [0, num_axes[ + // (or [-num_axes, -1] for reverse // indexing) -- this special case simulates the one-padding used to fill // extraneous axes of legacy blobs. return 1;