mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 10:38:54 +00:00
Add some basic test.
This commit is contained in:
10
tests/tensor_tests.rs
Normal file
10
tests/tensor_tests.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use candle::{DType, Device, Result, Tensor};
|
||||
|
||||
#[test]
|
||||
fn add() -> Result<()> {
|
||||
let tensor = Tensor::zeros(&[5, 2], DType::F32, Device::Cpu);
|
||||
let (dim1, dim2) = tensor.shape2()?;
|
||||
assert_eq!(dim1, 5);
|
||||
assert_eq!(dim2, 2);
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user