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

Method init_len

crates/vm/src/builtins/memory.rs:241–244  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

239 }
240
241 fn init_len(&mut self) {
242 let product: usize = self.desc.dim_desc.iter().map(|x| x.0).product();
243 self.desc.len = product * self.desc.itemsize;
244 }
245
246 fn init_range(&mut self, range: Range<usize>, dim: usize) {
247 let (shape, stride, _) = self.desc.dim_desc[dim];

Callers 3

from_buffer_rangeMethod · 0.80
getitem_by_sliceMethod · 0.80
setitem_by_sliceMethod · 0.80

Calls 2

mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected