pub fn validate_shape(shape: &[usize], data_len: usize) -> Result<(), String>
Validate that a shape and data length are consistent.