| 256 | } |
| 257 | |
| 258 | bp::object BlobVec_add_blob(bp::tuple args, bp::dict kwargs) { |
| 259 | if (bp::len(kwargs) > 0) { |
| 260 | throw std::runtime_error("BlobVec.add_blob takes no kwargs"); |
| 261 | } |
| 262 | typedef vector<shared_ptr<Blob<Dtype> > > BlobVec; |
| 263 | BlobVec* self = bp::extract<BlobVec*>(args[0]); |
| 264 | vector<int> shape(bp::len(args) - 1); |
| 265 | for (int i = 1; i < bp::len(args); ++i) { |
| 266 | shape[i - 1] = bp::extract<int>(args[i]); |
| 267 | } |
| 268 | self->push_back(shared_ptr<Blob<Dtype> >(new Blob<Dtype>(shape))); |
| 269 | // We need to explicitly return None to use bp::raw_function. |
| 270 | return bp::object(); |
| 271 | } |
| 272 | |
| 273 | template<typename Dtype> |
| 274 | class SolverCallback: public Solver<Dtype>::Callback { |
nothing calls this directly
no outgoing calls
no test coverage detected