Skip to content

Commit

Permalink
fix bugs by adding const
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjiec committed Jan 23, 2015
1 parent 64b68b2 commit f4b3865
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions matlab/caffe/matcaffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int init_key = -2;
// input and outputs a cell array.

static mxArray* do_forward(const mxArray* const bottom) {
vector<Blob<float>*>& input_blobs = net_->input_blobs();
const vector<Blob<float>*>& input_blobs = net_->input_blobs();
if (static_cast<unsigned int>(mxGetDimensions(bottom)[0]) !=
input_blobs.size()) {
mex_error("Invalid input size");
Expand Down Expand Up @@ -112,8 +112,8 @@ static mxArray* do_forward(const mxArray* const bottom) {
}

static mxArray* do_backward(const mxArray* const top_diff) {
vector<Blob<float>*>& output_blobs = net_->output_blobs();
vector<Blob<float>*>& input_blobs = net_->input_blobs();
const vector<Blob<float>*>& output_blobs = net_->output_blobs();
const vector<Blob<float>*>& input_blobs = net_->input_blobs();
if (static_cast<unsigned int>(mxGetDimensions(top_diff)[0]) !=
output_blobs.size()) {
mex_error("Invalid input size");
Expand Down

0 comments on commit f4b3865

Please sign in to comment.