Add external multimodal processors to the Rust frontend (#39329)

This commit is contained in:
Lianmin Zheng
2026-09-15 15:38:47 -07:00
committed by GitHub
parent 2929a39927
commit b803cfa0c4
20 changed files with 1027 additions and 197 deletions
+16
View File
@@ -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 {