diff options
author | Jeff Donahue <jeff.donahue@gmail.com> | 2014-11-26 05:42:11 -0800 |
---|---|---|
committer | Jeff Donahue <jeff.donahue@gmail.com> | 2015-03-03 15:55:15 -0800 |
commit | e6468e900f03b2c4f2d9ccf160b46bff0f52dfb9 (patch) | |
tree | 168e8494dab77bc4714c7a01ddccaa4afdd76b37 /src/caffe/util/io.cpp | |
parent | e2bc9f997d5ebfbefdc4a7e2fa0da9b029c1573a (diff) | |
download | caffeonacl-e6468e900f03b2c4f2d9ccf160b46bff0f52dfb9.tar.gz caffeonacl-e6468e900f03b2c4f2d9ccf160b46bff0f52dfb9.tar.bz2 caffeonacl-e6468e900f03b2c4f2d9ccf160b46bff0f52dfb9.zip |
HDF5DataLayer shapes output according to HDF5 shape
Diffstat (limited to 'src/caffe/util/io.cpp')
-rw-r--r-- | src/caffe/util/io.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp index b243a980..77ef7f25 100644 --- a/src/caffe/util/io.cpp +++ b/src/caffe/util/io.cpp @@ -252,11 +252,11 @@ void hdf5_load_nd_dataset_helper( CHECK_GE(status, 0) << "Failed to get dataset info for " << dataset_name_; CHECK_EQ(class_, H5T_FLOAT) << "Expected float or double data"; - blob->Reshape( - dims[0], - (dims.size() > 1) ? dims[1] : 1, - (dims.size() > 2) ? dims[2] : 1, - (dims.size() > 3) ? dims[3] : 1); + vector<int> blob_dims(dims.size()); + for (int i = 0; i < dims.size(); ++i) { + blob_dims[i] = dims[i]; + } + blob->Reshape(blob_dims); } template <> |