MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / map_with_kwargs

Function map_with_kwargs

src/python/py_kernel.rs:723–738  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

721
722 #[test]
723 fn map_with_kwargs() {
724 pyo3::prepare_freethreaded_python();
725 Python::with_gil(|py| {
726 let km = PyKernelModule::new();
727 let x = km.arg("x");
728 let spec = km.elementwise(x).unwrap();
729
730 let kwargs = pyo3::types::PyDict::new(py);
731 let buf = PyBuffer::new(Buffer::from_f64_vec(vec![1.0, 2.0]));
732 kwargs
733 .set_item("x", buf.into_pyobject(py).unwrap())
734 .unwrap();
735 let map_spec = km.map(&spec, Some(&kwargs.as_borrowed())).unwrap();
736 assert_eq!(map_spec.args.len(), 1);
737 });
738 }
739
740 #[test]
741 fn map_with_scalar_kwarg() {

Callers

nothing calls this directly

Calls 3

argMethod · 0.45
elementwiseMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected