(&self)
| 234 | } |
| 235 | |
| 236 | pub fn is_contiguous(&self) -> bool { |
| 237 | if self.len == 0 { |
| 238 | return true; |
| 239 | } |
| 240 | let mut sd = self.itemsize; |
| 241 | for (shape, stride, _) in self.dim_desc.iter().cloned().rev() { |
| 242 | if shape > 1 && stride != sd as isize { |
| 243 | return false; |
| 244 | } |
| 245 | sd *= shape; |
| 246 | } |
| 247 | true |
| 248 | } |
| 249 | |
| 250 | /// this function do not check the bound |
| 251 | /// panic if indices.len() != ndim |
no test coverage detected