Skip to content

Commit

Permalink
pycaffe: add shape accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdonahue authored and matthiasplappert committed Aug 10, 2015
1 parent cf9132d commit b70f83f
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 b70f83f

Please sign in to comment.