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:
a865a24
)
pycaffe: add shape accessor
author
Jeff Donahue
<jeff.donahue@gmail.com>
Thu, 6 Aug 2015 20:46:11 +0000
(13:46 -0700)
committer
Jeff Donahue
<jeff.donahue@gmail.com>
Fri, 7 Aug 2015 20:54:41 +0000
(13:54 -0700)
python/caffe/_caffe.cpp
patch
|
blob
|
history
diff --git
a/python/caffe/_caffe.cpp
b/python/caffe/_caffe.cpp
index
dff7f62
..
bb5130f
100644
(file)
--- a/
python/caffe/_caffe.cpp
+++ b/
python/caffe/_caffe.cpp
@@
-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)