pub fn abs_device(
a: impl AsRef<Array>,
stream: impl AsRef<Stream>,
) -> Result<Array>
Expand description
Element-wise absolute value.
ยงExample
use mlx_rs::{Array, ops};
let array = Array::from_slice(&[1i32, 2, -3, -4, -5], &[5]);
let result = ops::abs(&array).unwrap();