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

Function rows_dot

examples/parallel/src/lib.rs:11–20  ·  view source on GitHub ↗
(
        py: Python<'py>,
        x: PyReadonlyArray2<'py, f64>,
        y: PyReadonlyArray1<'py, f64>,
    )

Source from the content-addressed store, hash-verified

9
10 #[pyfunction]
11 fn rows_dot<'py>(
12 py: Python<'py>,
13 x: PyReadonlyArray2<'py, f64>,
14 y: PyReadonlyArray1<'py, f64>,
15 ) -> Bound<'py, PyArray1<f64>> {
16 let x = x.as_array();
17 let y = y.as_array();
18 let z = Zip::from(x.rows()).par_map_collect(|row| row.dot(&y));
19 z.into_pyarray(py)
20 }
21}

Callers

nothing calls this directly

Calls 2

into_pyarrayMethod · 0.80
as_arrayMethod · 0.45

Tested by

no test coverage detected