mirror of
https://github.com/huggingface/candle.git
synced 2025-06-21 20:22:49 +00:00
Rename as_slice to storage_data and implement the cuda version.
This commit is contained in:
@ -29,11 +29,11 @@ fn matmul_grad() -> Result<()> {
|
||||
assert_eq!(grad_x.shape(), &Shape::from((2, 2, 3)));
|
||||
assert_eq!(grad_y.shape(), &Shape::from((2, 3, 2)));
|
||||
assert_eq!(
|
||||
grad_x.as_slice::<f32>()?,
|
||||
&*grad_x.storage_data::<f32>()?,
|
||||
&[1., 5., 9., 1., 5., 9., 13., 17., 21., 13., 17., 21.]
|
||||
);
|
||||
assert_eq!(
|
||||
grad_y.as_slice::<f32>()?,
|
||||
&*grad_y.storage_data::<f32>()?,
|
||||
&[3., 3., 5., 5., 7., 7., 15., 15., 17., 17., 19., 19.]
|
||||
);
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user