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

Method shape

crates/vm/src/builtins/memory.rs:593–602  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

591
592 #[pygetset]
593 fn shape(&self, vm: &VirtualMachine) -> PyResult<PyTupleRef> {
594 self.try_not_released(vm)?;
595 Ok(vm.ctx.new_tuple(
596 self.desc
597 .dim_desc
598 .iter()
599 .map(|(shape, _, _)| shape.to_pyobject(vm))
600 .collect(),
601 ))
602 }
603
604 #[pygetset]
605 fn strides(&self, vm: &VirtualMachine) -> PyResult<PyTupleRef> {

Callers

nothing calls this directly

Calls 6

try_not_releasedMethod · 0.80
collectMethod · 0.80
new_tupleMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
to_pyobjectMethod · 0.45

Tested by

no test coverage detected