MCPcopy Create free account
hub / github.com/catboost/catboost / resize

Method resize

contrib/libs/pybind11/include/pybind11/numpy.h:1060–1074  ·  view source on GitHub ↗

Resize array to given shape If refcheck is true and more that one reference exist to this array then resize will succeed only if it makes a reshape, i.e. original size doesn't change

Source from the content-addressed store, hash-verified

1058 /// If refcheck is true and more that one reference exist to this array
1059 /// then resize will succeed only if it makes a reshape, i.e. original size doesn't change
1060 void resize(ShapeContainer new_shape, bool refcheck = true) {
1061 detail::npy_api::PyArray_Dims d
1062 = {// Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)
1063 reinterpret_cast<Py_intptr_t *>(new_shape->data()),
1064 int(new_shape->size())};
1065 // try to resize, set ordering param to -1 cause it's not used anyway
1066 auto new_array = reinterpret_steal<object>(
1067 detail::npy_api::get().PyArray_Resize_(m_ptr, &d, int(refcheck), -1));
1068 if (!new_array) {
1069 throw error_already_set();
1070 }
1071 if (isinstance<array>(new_array)) {
1072 *this = std::move(new_array);
1073 }
1074 }
1075
1076 /// Optional `order` parameter omitted, to be added as needed.
1077 array reshape(ShapeContainer new_shape) {

Callers 15

MessageGeneratorMethod · 0.45
DeleteByNumberMethod · 0.45
ShortUtf8DebugStringFunction · 0.45
SetOptionValueMethod · 0.45
ShortDebugStringMethod · 0.45
ParseMessageSetItemImplFunction · 0.45
FindAllFileNamesMethod · 0.45
BackUpMethod · 0.45
OutdentMethod · 0.45
CEscapeAndAppendFunction · 0.45
StrCatFunction · 0.45

Calls 4

moveFunction · 0.70
getFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected