diff options
author | laurent <laurent.mazare@gmail.com> | 2023-06-22 07:51:53 +0100 |
---|---|---|
committer | laurent <laurent.mazare@gmail.com> | 2023-06-22 07:51:53 +0100 |
commit | fc26bab3ede511c3c4d2f1afb15f58eb6c588c94 (patch) | |
tree | 8ca6d8cf9a493b7c1d6f59a1f0181b6a2f405703 /src/cuda_backend.rs | |
parent | db35b310504ab97044b2c3826de72f9bccf86415 (diff) | |
download | candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.gz candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.bz2 candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.zip |
Add some specific errors rather than panicking.
Diffstat (limited to 'src/cuda_backend.rs')
-rw-r--r-- | src/cuda_backend.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cuda_backend.rs b/src/cuda_backend.rs index d12db972..7858e542 100644 --- a/src/cuda_backend.rs +++ b/src/cuda_backend.rs @@ -1,4 +1,4 @@ -use crate::{CpuStorage, DType, Result, Shape}; +use crate::{CpuStorage, DType, Error, Result, Shape}; use cudarc::driver::{CudaSlice, LaunchAsync, LaunchConfig}; pub type CudaError = cudarc::driver::DriverError; @@ -92,7 +92,7 @@ impl CudaStorage { match self { Self::F32(arg) => { if !shape.is_contiguous(stride) { - todo!("affine is only implemented for the contiguous case") + return Err(Error::RequiresContiguous { op: "affine" }); } let dev = arg.device(); let module_name = "affine_f32"; |