Add cuda support for unary ops.

This commit is contained in:
laurent
2023-06-22 15:12:59 +01:00
parent b8f514d9c6
commit 5276755fb3
7 changed files with 101 additions and 23 deletions

View File

@ -8,6 +8,7 @@ fn main() -> Result<()> {
let y = Tensor::new(&[2f32, 7., 1., 8., 2.], &device)?;
let z = (y + x * 3.)?;
println!("{:?}", z.to_vec1::<f32>()?);
println!("{:?}", z.sqrt()?.to_vec1::<f32>()?);
let x = Tensor::ones((3, 2), DType::F32, &device)?;
println!("{:?}", x.to_vec2::<f32>()?);
Ok(())