ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
ndarray_shape.cpp File Reference
#include <python-frontend/numpy/ndarray_shape.h>
#include <limits>
#include <stdexcept>
Include dependency graph for ndarray_shape.cpp:

Functions

void validate_ndarray_shape (const std::vector< long long > &shape)
 Validates a shape vector on its own, ahead of building the backing buffer (e.g.

Function Documentation

◆ validate_ndarray_shape()

void validate_ndarray_shape ( const std::vector< long long > & shape)

Validates a shape vector on its own, ahead of building the backing buffer (e.g.

for np.zeros/np.ones/np.full call sites). Throws std::runtime_error with a NumPy-compatible ValueError message when a dimension is negative or the element count overflows.