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

Function generic_add

examples/simple/src/lib.rs:40–45  ·  view source on GitHub ↗

example using generics

(
        x: ArrayView1<'_, T>,
        y: ArrayView1<'_, T>,
    )

Source from the content-addressed store, hash-verified

38
39 // example using generics
40 fn generic_add<T: Copy + Add<Output = T>>(
41 x: ArrayView1<'_, T>,
42 y: ArrayView1<'_, T>,
43 ) -> Array1<T> {
44 &x + &y
45 }
46
47 // wrapper of `head`
48 #[pyfunction(name = "head")]

Callers 1

polymorphic_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected