зеркало из https://github.com/microsoft/caffe.git
Merge pull request #888 from ronghanghu/matcaffe-add-check
add necessary input checks for matcaffe
This commit is contained in:
Коммит
c13fded3ac
|
@ -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()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче