Skip to content
fn

to_mlx_shape

→mlx::core::Shape
int to_mlx_shape(const int & shape)

Convert a Lucid Shape (int64) to an mlx::core::Shape (int32).

Parameters

shapeconst Shape&
Source shape vector.

Returns

mlx::core::Shape

std::vector<int32_t> view of the same dimensions.

Raises

:overflow_error
If any dimension exceeds INT32_MAX — MLX is currently int32-indexed and cannot represent larger extents.