Add the op.

This commit is contained in:
laurent
2023-06-19 18:34:54 +01:00
parent 844704de5c
commit ce718bb807
5 changed files with 45 additions and 13 deletions

View File

@ -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,
}
}
}