MCPcopy Index your code
hub / github.com/YuminosukeSato/ironkernel / numpy

Method numpy

src/python/py_buffer.rs:22–25  ·  view source on GitHub ↗

Convert to numpy array (copies data out).

(&self, py: Python<'py>)

Source from the content-addressed store, hash-verified

20impl PyBuffer {
21 /// Convert to numpy array (copies data out).
22 fn numpy<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyArray1<f64>>> {
23 let slice = self.inner.as_f64_slice();
24 Ok(PyArray1::from_slice(py, slice))
25 }
26
27 /// Get a single scalar value (first element).
28 fn scalar(&self) -> PyResult<f64> {

Callers 15

test_saxpyMethod · 0.80
test_saxpy_1mMethod · 0.80
test_negationMethod · 0.80
test_subtractionMethod · 0.80
test_divisionMethod · 0.80
test_reverse_opsMethod · 0.80
test_sqrt_abs_sinMethod · 0.80
test_log_expMethod · 0.80
test_floor_ceil_roundMethod · 0.80
test_reluMethod · 0.80

Calls 1

as_f64_sliceMethod · 0.80

Tested by 15

test_saxpyMethod · 0.64
test_saxpy_1mMethod · 0.64
test_negationMethod · 0.64
test_subtractionMethod · 0.64
test_divisionMethod · 0.64
test_reverse_opsMethod · 0.64
test_sqrt_abs_sinMethod · 0.64
test_log_expMethod · 0.64
test_floor_ceil_roundMethod · 0.64
test_reluMethod · 0.64