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

Function not_aligned_array

tests/array.rs:35–44  ·  view source on GitHub ↗
(py: Python<'_>)

Source from the content-addressed store, hash-verified

33}
34
35fn not_aligned_array(py: Python<'_>) -> Bound<'_, PyArray1<u16>> {
36 py.eval(
37 c_str!("np.zeros(8, dtype='u2').view('u1')[1:-1].view('u2')"),
38 None,
39 Some(&get_np_locals(py)),
40 )
41 .unwrap()
42 .cast_into()
43 .unwrap()
44}
45
46#[test]
47fn new_c_order() {

Callers 1

as_sliceFunction · 0.85

Calls 1

get_np_localsFunction · 0.70

Tested by 1

as_sliceFunction · 0.68