Adding embedding op (not generic gather, no select).

This commit is contained in:
Nicolas Patry
2023-06-22 22:47:35 +02:00
parent 4ffdeb4e23
commit 5e54f37fe1
8 changed files with 154 additions and 0 deletions

View File

@ -15,6 +15,13 @@ pub enum Error {
#[error("backward is not supported for {op}")]
BackwardNotSupported { op: &'static str },
#[error("{op} invalid index {index} with vocab {vocab_size}")]
InvalidIndex {
op: &'static str,
index: usize,
vocab_size: usize,
},
#[error("the candle crate has not been built with cuda support")]
NotCompiledWithCudaSupport,
@ -65,6 +72,9 @@ pub enum Error {
#[error(transparent)]
Cuda(#[from] crate::CudaError),
#[error(transparent)]
TryFromIntError(#[from] core::num::TryFromIntError),
}
pub type Result<T> = std::result::Result<T, Error>;