Add external multimodal processors to the Rust frontend (#39329)
This commit is contained in:
@@ -13,6 +13,22 @@
|
||||
pub enum TensorData {
|
||||
F32(Vec<f32>),
|
||||
I64(Vec<i64>),
|
||||
/// Raw BF16 bits, exposed to numpy as u16 without copying the allocation.
|
||||
Bf16(Vec<u16>),
|
||||
}
|
||||
|
||||
impl TensorData {
|
||||
pub fn len(&self) -> usize {
|
||||
match self {
|
||||
Self::F32(data) => data.len(),
|
||||
Self::I64(data) => data.len(),
|
||||
Self::Bf16(data) => data.len(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.len() == 0
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Tensor {
|
||||
|
||||
Reference in New Issue
Block a user