summaryrefslogtreecommitdiff
path: root/examples/basics.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-06-21 21:37:54 +0100
committerGitHub <noreply@github.com>2023-06-21 21:37:54 +0100
commitdb35b310504ab97044b2c3826de72f9bccf86415 (patch)
tree710596156a4c026d4dd2ba804fab79b6cdafae3b /examples/basics.rs
parent7c317f9611c263f10d661b44151d3655a2fa3b90 (diff)
parent7c46de9584fd4315b84d3bc4c28cf1b2bad7785d (diff)
downloadcandle-db35b310504ab97044b2c3826de72f9bccf86415.tar.gz
candle-db35b310504ab97044b2c3826de72f9bccf86415.tar.bz2
candle-db35b310504ab97044b2c3826de72f9bccf86415.zip
Merge pull request #3 from LaurentMazare/cuda
Add Cuda support.
Diffstat (limited to 'examples/basics.rs')
-rw-r--r--examples/basics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/basics.rs b/examples/basics.rs
index f01f7871..d5d4f72b 100644
--- a/examples/basics.rs
+++ b/examples/basics.rs
@@ -2,7 +2,7 @@ use anyhow::Result;
use candle::{Device, Tensor};
fn main() -> Result<()> {
- let x = Tensor::var(&[3f32, 1., 4.], Device::Cpu)?;
+ let x = Tensor::var(&[3f32, 1., 4.], &Device::Cpu)?;
let y = (((&x * &x)? + &x * 5f64)? + 4f64)?;
println!("{:?}", y.to_vec1::<f32>()?);
Ok(())