Add a first kernel.

This commit is contained in:
laurent
2023-06-21 20:48:22 +01:00
parent fcb4e6b84f
commit 97d9142dee
3 changed files with 57 additions and 4 deletions

View File

@ -4,9 +4,9 @@ use candle::{Device, Tensor};
fn main() -> Result<()> {
let device = Device::new_cuda(0)?;
let x = Tensor::new(&[3f32, 1., 4., 1., 5.], &device)?;
let y = Tensor::new(&[2f32, 7., 1., 8., 2.], &device)?;
println!("{:?}", x.to_vec1::<f32>()?);
let z = (x + y)?;
let y = Tensor::new(&[2f32, 7., 1., 8., 2.], &device)?;
let z = (y * 3.)?;
println!("{:?}", z.to_vec1::<f32>()?);
Ok(())
}