Add i64-abs. (#1216)

This commit is contained in:
Laurent Mazare
2023-10-29 16:28:53 +01:00
committed by GitHub
parent 7bbde55c61
commit 154c674a79
2 changed files with 42 additions and 1 deletions

View File

@ -1089,3 +1089,11 @@ fn pad_with_same() -> Result<()> {
);
Ok(())
}
#[test]
fn i64_abs() -> Result<()> {
let t = Tensor::new(&[-42i64, 1337], &Device::Cpu)?;
let t = t.abs()?;
assert_eq!(t.to_vec1::<i64>()?, [42, 1337]);
Ok(())
}