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:
8fef285
)
Added a couple of sanity checks to make sure the datum buffer sizes matched what...
author
Kevin James Matzen
<kmatzen@cs.cornell.edu>
Sun, 12 Oct 2014 18:47:04 +0000
(14:47 -0400)
committer
Kevin James Matzen
<kmatzen@cs.cornell.edu>
Tue, 14 Oct 2014 23:31:30 +0000
(19:31 -0400)
tools/compute_image_mean.cpp
patch
|
blob
|
history
diff --git
a/tools/compute_image_mean.cpp
b/tools/compute_image_mean.cpp
index
01e16c1
..
aaa324a
100644
(file)
--- a/
tools/compute_image_mean.cpp
+++ b/
tools/compute_image_mean.cpp
@@
-62,10
+62,12
@@
int main(int argc, char** argv) {
CHECK_EQ(size_in_datum, data_size) << "Incorrect data field size " <<
size_in_datum;
if (data.size() != 0) {
+ CHECK_EQ(data.size(), size_in_datum);
for (int i = 0; i < size_in_datum; ++i) {
sum_blob.set_data(i, sum_blob.data(i) + (uint8_t)data[i]);
}
} else {
+ CHECK_EQ(datum.float_data_size(), size_in_datum);
for (int i = 0; i < size_in_datum; ++i) {
sum_blob.set_data(i, sum_blob.data(i) +
static_cast<float>(datum.float_data(i)));