projects
/
platform
/
upstream
/
caffe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d82a1ea
)
add necessary input checks for matcaffe
author
Ronghang Hu
<huronghang@hotmail.com>
Fri, 8 Aug 2014 22:47:23 +0000
(15:47 -0700)
committer
Ronghang Hu
<huronghang@hotmail.com>
Fri, 8 Aug 2014 22:47:23 +0000
(15:47 -0700)
matlab/caffe/matcaffe.cpp
patch
|
blob
|
history
diff --git
a/matlab/caffe/matcaffe.cpp
b/matlab/caffe/matcaffe.cpp
index
957ebea
..
f4a2425
100644
(file)
--- a/
matlab/caffe/matcaffe.cpp
+++ b/
matlab/caffe/matcaffe.cpp
@@
-50,6
+50,10
@@
static mxArray* do_forward(const mxArray* const bottom) {
input_blobs.size());
for (unsigned int i = 0; i < input_blobs.size(); ++i) {
const mxArray* const elem = mxGetCell(bottom, i);
+ CHECK(mxIsSingle(elem))
+ << "MatCaffe require single-precision float point data";
+ CHECK_EQ(mxGetNumberOfElements(elem), input_blobs[i]->count())
+ << "MatCaffe input size does not match the input size of the network";
const float* const data_ptr =
reinterpret_cast<const float* const>(mxGetPr(elem));
switch (Caffe::mode()) {