MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_contiguous

Method is_contiguous

crates/vm/src/protocol/buffer.rs:236–248  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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

Callers 12

as_contiguousMethod · 0.80
as_contiguous_mutMethod · 0.80
from_buffer_implMethod · 0.80
obj_bytesMethod · 0.80
obj_bytes_mutMethod · 0.80
as_contiguousMethod · 0.80
_as_contiguous_mutMethod · 0.80
contiguousMethod · 0.80
c_contiguousMethod · 0.80
f_contiguousMethod · 0.80
castMethod · 0.80

Calls 2

revMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected