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

Method reshape

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

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

Source from the content-addressed store, hash-verified

1067
1068 /// Optional `order` parameter omitted, to be added as needed.
1069 array reshape(ShapeContainer new_shape) {
1070 detail::npy_api::PyArray_Dims d
1071 = {reinterpret_cast<Py_intptr_t *>(new_shape->data()), int(new_shape->size())};
1072 auto new_array
1073 = reinterpret_steal<array>(detail::npy_api::get().PyArray_Newshape_(m_ptr, &d, 0));
1074 if (!new_array) {
1075 throw error_already_set();
1076 }
1077 return new_array;
1078 }
1079
1080 /// Create a view of an array in a different data type.
1081 /// This function may fundamentally reinterpret the data in the array.

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected