Crate ndslice

Source
Expand description

Core mesh components for the hyperactor framework.

Provides Slice, a compact representation of a subset of a multidimensional array. See Slice for more details.

This crate defines the foundational abstractions used in hyperactor’s mesh layer, including multidimensional shapes and selection algebra. The crate avoids dependencies on procedural macros and other higher-level constructs, enabling reuse in both runtime and macro contexts.

Re-exports§

pub use selection::Selection;
pub use selection::dsl;
pub use shape::Range;
pub use shape::Shape;
pub use shape::ShapeError;
pub use view::Extent;
pub use view::ExtentError;
pub use view::InExtent;
pub use view::Point;
pub use view::PointError;
pub use view::View;
pub use view::ViewExt;
pub use view::ViewIterator;
pub use view::Viewable;

Modules§

reshape
Reshaping transformations for multidimensional slices and shapes. Dimensional reshaping of slices and shapes.
selection
Selection algebra for describing multidimensional mesh regions. This module defines a recursive algebra for selecting coordinates in a multidimensional space.
shape
Core types for representing multidimensional shapes and strides.
utils
Utilities.
view
Types to describe extents, points and views.

Macros§

assert_round_trip
assert_structurally_eq
extent
Construct a new extent with the given set of dimension-size pairs.
sel_from_shape
Construct a Selection from a Shape using labeled dimension constraints.
select
Perform a sub-selection on the provided Shape object.
shape
Construct a new shape with the given set of dimension-size pairs in row-major order.

Structs§

DimSliceIterator
Iterates over the Cartesian product of a list of dimension sizes.
Slice
Slice is a compact representation of indices into the flat representation of an n-dimensional array. Given an offset, sizes of each dimension, and strides for each dimension, Slice can compute indices into the flat array.
SliceIterator

Enums§

SliceError
The type of error for slice operations.