mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 11:56:45 +00:00
Add the op.
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use crate::{DType, Device};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) enum Storage {
|
||||
Cpu {
|
||||
@ -5,3 +7,17 @@ pub(crate) enum Storage {
|
||||
buffer: Vec<u8>,
|
||||
},
|
||||
}
|
||||
|
||||
impl Storage {
|
||||
pub(crate) fn device(&self) -> Device {
|
||||
match self {
|
||||
Self::Cpu { .. } => Device::Cpu,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn dtype(&self) -> DType {
|
||||
match self {
|
||||
Self::Cpu { dtype, .. } => *dtype,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user