| 242 | }; |
| 243 | |
| 244 | bp::object Blob_Reshape(bp::tuple args, bp::dict kwargs) { |
| 245 | if (bp::len(kwargs) > 0) { |
| 246 | throw std::runtime_error("Blob.reshape takes no kwargs"); |
| 247 | } |
| 248 | Blob<Dtype>* self = bp::extract<Blob<Dtype>*>(args[0]); |
| 249 | vector<int> shape(bp::len(args) - 1); |
| 250 | for (int i = 1; i < bp::len(args); ++i) { |
| 251 | shape[i - 1] = bp::extract<int>(args[i]); |
| 252 | } |
| 253 | self->Reshape(shape); |
| 254 | // We need to explicitly return None to use bp::raw_function. |
| 255 | return bp::object(); |
| 256 | } |
| 257 | |
| 258 | bp::object BlobVec_add_blob(bp::tuple args, bp::dict kwargs) { |
| 259 | if (bp::len(kwargs) > 0) { |