MCPcopy Create free account
hub / github.com/davisking/dlib / reshape

Method reshape

dlib/external/pybind11/include/pybind11/numpy.h:1291–1300  ·  view source on GitHub ↗

Optional `order` parameter omitted, to be added as needed.

Source from the content-addressed store, hash-verified

1289
1290 /// Optional `order` parameter omitted, to be added as needed.
1291 array reshape(ShapeContainer new_shape) {
1292 detail::npy_api::PyArray_Dims d
1293 = {reinterpret_cast<Py_intptr_t *>(new_shape->data()), int(new_shape->size())};
1294 auto new_array
1295 = reinterpret_steal<array>(detail::npy_api::get().PyArray_Newshape_(m_ptr, &d, 0));
1296 if (!new_array) {
1297 throw error_already_set();
1298 }
1299 return new_array;
1300 }
1301
1302 /// Create a view of an array in a different data type.
1303 /// This function may fundamentally reinterpret the data in the array.

Callers

nothing calls this directly

Calls 3

getFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected