in safetensors/src/slice.rs [30:46]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match *self {
InvalidSlice::TooManySlices => {
write!(f, "more slicing indexes than dimensions in tensor")
}
InvalidSlice::SliceOutOfRange {
dim_index,
asked,
dim_size,
} => {
write!(f, "index {asked} out of bounds for tensor dimension #{dim_index} of size {dim_size}")
}
InvalidSlice::MisalignedSlice => {
write!(f, "The slice is slicing for subbytes dtypes, and the slice does not end up at a byte boundary, this is invalid.")
}
}
}