MCPcopy Index your code
hub / github.com/PyO3/rust-numpy / zeros

Function zeros

tests/array.rs:121–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119
120#[test]
121fn zeros() {
122 Python::attach(|py| {
123 let dims = [3, 4];
124
125 let arr = PyArray::<f64, _>::zeros(py, dims, false);
126
127 assert!(arr.ndim() == 2);
128 assert!(arr.dims() == dims);
129
130 let size = size_of::<f64>() as isize;
131 assert!(arr.strides() == [dims[1] as isize * size, size]);
132
133 let arr = PyArray::<f64, _>::zeros(py, dims, true);
134
135 assert!(arr.ndim() == 2);
136 assert!(arr.dims() == dims);
137
138 let size = size_of::<f64>() as isize;
139 assert!(arr.strides() == [size, dims[0] as isize * size]);
140 });
141}
142
143#[test]
144fn arange() {

Callers 15

extract_successFunction · 0.85
extract_failureFunction · 0.85
cast_successFunction · 0.85
cast_failureFunction · 0.85
initial_shared_borrowFunction · 0.85
additional_shared_borrowFunction · 0.85
exclusive_borrowFunction · 0.85
innerFunction · 0.85
from_rust_to_pythonFunction · 0.85
test_debug_formattingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected