From fcb4e6b84fa755834e1c76b49e5d167c50c47d14 Mon Sep 17 00:00:00 2001 From: laurent Date: Wed, 21 Jun 2023 19:55:57 +0100 Subject: Use a reference for the device. --- examples/basics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/basics.rs') 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::()?); Ok(()) -- cgit v1.2.3