normalize_dim

Function normalize_dim 

Source
pub fn normalize_dim(dim: i64, ndim: usize) -> Result<usize>
Expand description

Normalizes a dimension index, supporting negative indexing.

§Arguments

  • dim - Dimension index (can be negative)
  • ndim - Number of dimensions

§Returns

Normalized positive index, or error if out of bounds.