mirror of
https://github.com/huggingface/candle.git
synced 2025-06-20 04:00:28 +00:00
10 lines
230 B
Rust
10 lines
230 B
Rust
use anyhow::Result;
|
|
use candle::{DType, Device, Tensor};
|
|
|
|
fn main() -> Result<()> {
|
|
let device = Device::new_cuda(0)?;
|
|
let x = Tensor::zeros(4, DType::F32, device)?;
|
|
println!("{:?}", x.to_vec1::<f32>()?);
|
|
Ok(())
|
|
}
|