mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Add more to the binary operators.
This commit is contained in:
16
src/error.rs
16
src/error.rs
@ -1,4 +1,4 @@
|
||||
use crate::{DType, Shape};
|
||||
use crate::{DType, Device, Shape};
|
||||
|
||||
/// Main library error type.
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
@ -13,6 +13,20 @@ pub enum Error {
|
||||
op: &'static str,
|
||||
},
|
||||
|
||||
#[error("device mismatch in {op}, lhs: {lhs:?}, rhs: {rhs:?}")]
|
||||
DeviceMismatchBinaryOp {
|
||||
lhs: Device,
|
||||
rhs: Device,
|
||||
op: &'static str,
|
||||
},
|
||||
|
||||
#[error("dtype mismatch in {op}, lhs: {lhs:?}, rhs: {rhs:?}")]
|
||||
DTypeMismatchBinaryOp {
|
||||
lhs: DType,
|
||||
rhs: DType,
|
||||
op: &'static str,
|
||||
},
|
||||
|
||||
#[error("unexpected rank, expected: {expected}, got: {got} ({shape:?})")]
|
||||
UnexpectedNumberOfDims {
|
||||
expected: usize,
|
||||
|
Reference in New Issue
Block a user