pub enum CpuTensorMut<'a> {
F32 {
data: &'a mut [f32],
shape: &'a Shape,
},
F64 {
data: &'a mut [f64],
shape: &'a Shape,
},
F16 {
data: &'a mut [f16],
shape: &'a Shape,
},
BF16 {
data: &'a mut [bf16],
shape: &'a Shape,
},
I8 {
data: &'a mut [i8],
shape: &'a Shape,
},
I16 {
data: &'a mut [i16],
shape: &'a Shape,
},
I32 {
data: &'a mut [i32],
shape: &'a Shape,
},
I64 {
data: &'a mut [i64],
shape: &'a Shape,
},
U8 {
data: &'a mut [u8],
shape: &'a Shape,
},
U32 {
data: &'a mut [u32],
shape: &'a Shape,
},
Bool {
data: &'a mut [u8],
shape: &'a Shape,
},
}Expand description
Mutable typed view of the output tensor handed to a CpuKernel.
Variants§
Implementations§
Source§impl<'a> CpuTensorMut<'a>
impl<'a> CpuTensorMut<'a>
pub fn shape(&self) -> &Shape
pub fn dtype(&self) -> DType
pub fn as_f32_mut(self) -> Option<&'a mut [f32]>
pub fn expect_f32_mut(self, role: &str) -> Result<&'a mut [f32], String>
pub fn as_f64_mut(self) -> Option<&'a mut [f64]>
pub fn expect_f64_mut(self, role: &str) -> Result<&'a mut [f64], String>
pub fn as_f16_mut(self) -> Option<&'a mut [f16]>
pub fn expect_f16_mut(self, role: &str) -> Result<&'a mut [f16], String>
pub fn as_bf16_mut(self) -> Option<&'a mut [bf16]>
pub fn expect_bf16_mut(self, role: &str) -> Result<&'a mut [bf16], String>
pub fn as_i8_mut(self) -> Option<&'a mut [i8]>
pub fn expect_i8_mut(self, role: &str) -> Result<&'a mut [i8], String>
pub fn as_i16_mut(self) -> Option<&'a mut [i16]>
pub fn expect_i16_mut(self, role: &str) -> Result<&'a mut [i16], String>
pub fn as_i32_mut(self) -> Option<&'a mut [i32]>
pub fn expect_i32_mut(self, role: &str) -> Result<&'a mut [i32], String>
pub fn as_i64_mut(self) -> Option<&'a mut [i64]>
pub fn expect_i64_mut(self, role: &str) -> Result<&'a mut [i64], String>
pub fn as_u8_mut(self) -> Option<&'a mut [u8]>
pub fn expect_u8_mut(self, role: &str) -> Result<&'a mut [u8], String>
pub fn as_u32_mut(self) -> Option<&'a mut [u32]>
pub fn expect_u32_mut(self, role: &str) -> Result<&'a mut [u32], String>
pub fn as_bool_mut(self) -> Option<&'a mut [u8]>
pub fn expect_bool_mut(self, role: &str) -> Result<&'a mut [u8], String>
Auto Trait Implementations§
impl<'a> Freeze for CpuTensorMut<'a>
impl<'a> RefUnwindSafe for CpuTensorMut<'a>
impl<'a> Send for CpuTensorMut<'a>
impl<'a> Sync for CpuTensorMut<'a>
impl<'a> Unpin for CpuTensorMut<'a>
impl<'a> UnsafeUnpin for CpuTensorMut<'a>
impl<'a> !UnwindSafe for CpuTensorMut<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more