pub fn rem(lhs: &Tensor, rhs: &Tensor) -> Result<Tensor>Expand description
Compute elementwise remainders on CPU tensors.
Integer remainders use wrapping two’s-complement arithmetic for the
MIN % -1 edge and return a structured error on zero divisors.
§Examples
use tenferro_cpu::rem;
use tenferro_tensor::Tensor;
let a = Tensor::from_vec_col_major(vec![2], vec![7_i32, -7])?;
let b = Tensor::from_vec_col_major(vec![2], vec![3_i32, 3])?;
let out = rem(&a, &b)?;
assert_eq!(out.as_slice::<i32>().unwrap(), &[1, -1]);