pub struct Float32Tensor {
pub shape: Vec<u64>,
pub data: Vec<f32>,
}
Fields§
§shape: Vec<u64>
§data: Vec<f32>
Trait Implementations§
Source§impl BaseTensorOps for Float32Tensor
impl BaseTensorOps for Float32Tensor
type Item = f32
fn shape(&self) -> &Vec<u64>
fn reshape(&self, shape: Vec<i64>) -> Result<Self>
fn from_values(shape: Vec<u64>, values: Vec<Self::Item>) -> Result<Self>
fn resolve_dim(&self, dim: i64) -> Result<u64>
fn resolve_shape(&self, shape2: Vec<i64>) -> Result<Vec<u64>>
fn zeros(shape: Vec<u64>) -> Result<Self>
fn ones(shape: Vec<u64>) -> Result<Self>
fn of(shape: Vec<u64>, v: Self::Item) -> Result<Self>where
Self: Sized,
fn rand(shape: Vec<u64>, rng: &mut impl Rng) -> Result<Self>where
Self: Sized,
Source§impl Debug for Float32Tensor
impl Debug for Float32Tensor
Source§impl TensorOps<Float32Tensor, f32> for Float32Tensor
impl TensorOps<Float32Tensor, f32> for Float32Tensor
fn sum(&self, dim: i64) -> Result<Float32Tensor>
fn item(&self) -> Result<Vec<Self::Item>>
fn size(&self) -> Result<usize>
fn apply(&self, f: impl Fn(Self::Item) -> Self::Item) -> Result<Float32Tensor>
fn apply_xy( &self, rhs: &Float32Tensor, f: impl Fn(Self::Item, Self::Item) -> Self::Item, ) -> Result<Float32Tensor>
fn matmul(&self, rhs: &Float32Tensor) -> Result<Float32Tensor>
fn max(&self) -> Result<I>where
I: PartialOrd + FloatCore,
fn log(&self, i: I) -> Result<T>where
I: Real,
fn ln(&self) -> Result<T>where
I: Real,
fn add(&self, rhs: &T) -> Result<T>
fn add_item(&self, rhs: &Self::Item) -> Result<T>
fn sub(&self, rhs: &T) -> Result<T>
fn sub_item(&self, rhs: &Self::Item) -> Result<T>
fn mul(&self, rhs: &T) -> Result<T>
fn mul_item(&self, rhs: &Self::Item) -> Result<T>
fn div_item(&self, rhs: &Self::Item) -> Result<T>
fn div(&self, rhs: &T) -> Result<T>
fn dim(&self, dim: i64) -> Result<u64>
fn sqrt(&self) -> Result<T>where
I: Real,
fn tanh(&self) -> Result<T>where
I: Real,
fn neg(&self) -> Result<T>where
I: Neg<Output = I>,
fn exp(&self) -> Result<T>where
I: Real,
Auto Trait Implementations§
impl Freeze for Float32Tensor
impl RefUnwindSafe for Float32Tensor
impl Send for Float32Tensor
impl Sync for Float32Tensor
impl Unpin for Float32Tensor
impl UnwindSafe for Float32Tensor
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