MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / extract_failure

Function extract_failure

benches/array.rs:21–33  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

19}
20
21fn extract_failure(c: &mut Criterion) {
22 Python::attach(|py| {
23 let any = PyArray2::<i32>::zeros(py, (10, 10), false).into_any();
24
25 c.bench_function("extract_failure", |b| {
26 b.iter(|| {
27 black_box(&any)
28 .extract::<Bound<'_, PyArray2<f64>>>()
29 .unwrap_err()
30 });
31 });
32 });
33}
34
35fn cast_success(c: &mut Criterion) {
36 Python::attach(|py| {

Callers

nothing calls this directly

Calls 1

zerosFunction · 0.85

Tested by

no test coverage detected