MCPcopy Create free account
hub / github.com/ml-explore/mlx / check_shape_dim

Function check_shape_dim

python/src/convert.cpp:17–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15};
16
17int check_shape_dim(int64_t dim) {
18 if (dim > std::numeric_limits<int>::max()) {
19 throw std::invalid_argument(
20 "Shape dimension falls outside supported `int` range.");
21 }
22 return static_cast<int>(dim);
23}
24
25template <typename T>
26mx::array nd_array_to_mlx_contiguous(

Callers 2

nd_array_to_mlxFunction · 0.85
get_shapeFunction · 0.85

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected