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

Function axpy_py

examples/simple/src/lib.rs:55–65  ·  view source on GitHub ↗
(
        py: Python<'py>,
        a: f64,
        x: PyReadonlyArrayDyn<'py, f64>,
        y: PyReadonlyArrayDyn<'py, f64>,
    )

Source from the content-addressed store, hash-verified

53 // wrapper of `axpy`
54 #[pyfunction(name = "axpy")]
55 fn axpy_py<'py>(
56 py: Python<'py>,
57 a: f64,
58 x: PyReadonlyArrayDyn<'py, f64>,
59 y: PyReadonlyArrayDyn<'py, f64>,
60 ) -> Bound<'py, PyArrayDyn<f64>> {
61 let x = x.as_array();
62 let y = y.as_array();
63 let z = axpy(a, x, y);
64 z.into_pyarray(py)
65 }
66
67 // wrapper of `mult`
68 #[pyfunction(name = "mult")]

Callers

nothing calls this directly

Calls 3

axpyFunction · 0.85
into_pyarrayMethod · 0.80
as_arrayMethod · 0.45

Tested by

no test coverage detected