mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 19:47:12 +00:00
Adding embedding op (not generic gather, no select).
This commit is contained in:
@ -2,6 +2,7 @@ use crate::{CpuStorage, Error, Result};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum DType {
|
||||
U32,
|
||||
F32,
|
||||
F64,
|
||||
}
|
||||
@ -9,6 +10,7 @@ pub enum DType {
|
||||
impl DType {
|
||||
pub fn size_in_bytes(&self) -> usize {
|
||||
match self {
|
||||
Self::U32 => 4,
|
||||
Self::F32 => 4,
|
||||
Self::F64 => 8,
|
||||
}
|
||||
@ -70,5 +72,6 @@ macro_rules! with_dtype {
|
||||
}
|
||||
};
|
||||
}
|
||||
with_dtype!(u32, U32);
|
||||
with_dtype!(f32, F32);
|
||||
with_dtype!(f64, F64);
|
||||
|
Reference in New Issue
Block a user