From 77197379cccda06f895da0c1b3fcb35d19e90bd3 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Fri, 15 Dec 2023 11:17:05 +0100 Subject: [PATCH] More cleanup. --- candle-core/src/tensor.rs | 5 +---- candle-core/tests/tensor_tests.rs | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/candle-core/src/tensor.rs b/candle-core/src/tensor.rs index 73a0cc7a..e478869a 100644 --- a/candle-core/src/tensor.rs +++ b/candle-core/src/tensor.rs @@ -1863,10 +1863,7 @@ impl Tensor { Storage::Metal(metal.storage_from_cpu_storage(storage)?) } (Storage::Cuda(storage), Device::Cpu) => Storage::Cpu(storage.to_cpu_storage()?), - (Storage::Metal(storage), Device::Cpu) => { - // println!("{storage:?} - {:?}", storage.to_cpu_storage()?); - Storage::Cpu(storage.to_cpu_storage()?) - } + (Storage::Metal(storage), Device::Cpu) => Storage::Cpu(storage.to_cpu_storage()?), (Storage::Cuda(storage), Device::Cuda(cuda)) => { // TODO: Avoid passing through the cpu storage here, especially if the gpu ids // are the same. diff --git a/candle-core/tests/tensor_tests.rs b/candle-core/tests/tensor_tests.rs index a77f9c3a..c871dc96 100644 --- a/candle-core/tests/tensor_tests.rs +++ b/candle-core/tests/tensor_tests.rs @@ -900,9 +900,7 @@ fn matmul(device: &Device) -> Result<()> { let b = Tensor::from_slice(&data, (2, 2), device)?; let c = a.matmul(&b)?; - let d = a.matmul(&c)?; assert_eq!(c.to_vec2::()?, &[[7.0f32, 10.0], [15.0, 22.0]]); - assert_eq!(d.to_vec2::()?, &[[37.0, 54.0], [81.0, 118.0]]); let data = vec![1.0f32, 2.0]; let a = Tensor::from_slice(&data, (2, 1), device)?;