| 225 | }; |
| 226 | |
| 227 | bp::object Blob_Reshape(bp::tuple args, bp::dict kwargs) { |
| 228 | if (bp::len(kwargs) > 0) { |
| 229 | throw std::runtime_error("Blob.reshape takes no kwargs"); |
| 230 | } |
| 231 | Blob<Dtype>* self = bp::extract<Blob<Dtype>*>(args[0]); |
| 232 | vector<int> shape(bp::len(args) - 1); |
| 233 | for (int i = 1; i < bp::len(args); ++i) { |
| 234 | shape[i - 1] = bp::extract<int>(args[i]); |
| 235 | } |
| 236 | self->Reshape(shape); |
| 237 | // We need to explicitly return None to use bp::raw_function. |
| 238 | return bp::object(); |
| 239 | } |
| 240 | |
| 241 | bp::object BlobVec_add_blob(bp::tuple args, bp::dict kwargs) { |
| 242 | if (bp::len(kwargs) > 0) { |