summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorlaurent <laurent.mazare@gmail.com>2023-06-22 07:51:53 +0100
committerlaurent <laurent.mazare@gmail.com>2023-06-22 07:51:53 +0100
commitfc26bab3ede511c3c4d2f1afb15f58eb6c588c94 (patch)
tree8ca6d8cf9a493b7c1d6f59a1f0181b6a2f405703 /src/error.rs
parentdb35b310504ab97044b2c3826de72f9bccf86415 (diff)
downloadcandle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.gz
candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.bz2
candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.zip
Add some specific errors rather than panicking.
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 3f142960..27201cb4 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -6,6 +6,12 @@ pub enum Error {
#[error("unexpected dtype, expected: {expected:?}, got: {got:?}")]
UnexpectedDType { expected: DType, got: DType },
+ #[error("{op} only supports contiguous tensors")]
+ RequiresContiguous { op: &'static str },
+
+ #[error("the candle crate has not been built with cuda support")]
+ NotCompiledWithCudaSupport,
+
#[error("shape mismatch in {op}, lhs: {lhs:?}, rhs: {rhs:?}")]
ShapeMismatchBinaryOp {
lhs: Shape,