MCPcopy Create free account
hub / github.com/numpy/numpy / raise_reshape_size_mismatch

Function raise_reshape_size_mismatch

numpy/core/src/multiarray/shape.c:465–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465static void
466raise_reshape_size_mismatch(PyArray_Dims *newshape, PyArrayObject *arr)
467{
468 PyObject *tmp = convert_shape_to_string(newshape->len, newshape->ptr, "");
469 if (tmp != NULL) {
470 PyErr_Format(PyExc_ValueError,
471 "cannot reshape array of size %zd into shape %S",
472 PyArray_SIZE(arr), tmp);
473 Py_DECREF(tmp);
474 }
475}
476
477static int
478_fix_unknown_dimension(PyArray_Dims *newshape, PyArrayObject *arr)

Callers 1

_fix_unknown_dimensionFunction · 0.85

Calls 1

convert_shape_to_stringFunction · 0.85

Tested by

no test coverage detected