Skip to content

Commit

Permalink
Merge pull request #2877 from jeffdonahue/pycaffe-shape-accessor
Browse files Browse the repository at this point in the history
[pycaffe] add Blob shape accessor
  • Loading branch information
longjon committed Aug 7, 2015
2 parents 32ced4f + 50195e3 commit 633ad15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/caffe/_caffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ BOOST_PYTHON_MODULE(_caffe) {

bp::class_<Blob<Dtype>, shared_ptr<Blob<Dtype> >, boost::noncopyable>(
"Blob", bp::no_init)
.add_property("shape",
bp::make_function(
static_cast<const vector<int>& (Blob<Dtype>::*)() const>(
&Blob<Dtype>::shape),
bp::return_value_policy<bp::copy_const_reference>()))
.add_property("num", &Blob<Dtype>::num)
.add_property("channels", &Blob<Dtype>::channels)
.add_property("height", &Blob<Dtype>::height)
Expand Down

0 comments on commit 633ad15

Please sign in to comment.