Struct Float32Tensor

Source
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

Source§

type Item = f32

Source§

fn shape(&self) -> &Vec<u64>

Source§

fn reshape(&self, shape: Vec<i64>) -> Result<Self>

Source§

fn from_values(shape: Vec<u64>, values: Vec<Self::Item>) -> Result<Self>

Source§

fn resolve_dim(&self, dim: i64) -> Result<u64>

Source§

fn resolve_shape(&self, shape2: Vec<i64>) -> Result<Vec<u64>>

Source§

fn zeros(shape: Vec<u64>) -> Result<Self>
where Self: Sized, Self::Item: ConstZero,

Source§

fn ones(shape: Vec<u64>) -> Result<Self>
where Self: Sized, Self::Item: ConstOne,

Source§

fn of(shape: Vec<u64>, v: Self::Item) -> Result<Self>
where Self: Sized,

Source§

fn rand(shape: Vec<u64>, rng: &mut impl Rng) -> Result<Self>
where Self: Sized,

Source§

impl Debug for Float32Tensor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TensorOps<Float32Tensor, f32> for Float32Tensor

Source§

fn sum(&self, dim: i64) -> Result<Float32Tensor>

Source§

fn item(&self) -> Result<Vec<Self::Item>>

Source§

fn size(&self) -> Result<usize>

Source§

fn apply(&self, f: impl Fn(Self::Item) -> Self::Item) -> Result<Float32Tensor>

Source§

fn apply_xy( &self, rhs: &Float32Tensor, f: impl Fn(Self::Item, Self::Item) -> Self::Item, ) -> Result<Float32Tensor>

Source§

fn matmul(&self, rhs: &Float32Tensor) -> Result<Float32Tensor>

Source§

fn max(&self) -> Result<I>
where I: PartialOrd + FloatCore,

Source§

fn log(&self, i: I) -> Result<T>
where I: Real,

Source§

fn ln(&self) -> Result<T>
where I: Real,

Source§

fn add(&self, rhs: &T) -> Result<T>

Source§

fn add_item(&self, rhs: &Self::Item) -> Result<T>

Source§

fn sub(&self, rhs: &T) -> Result<T>

Source§

fn sub_item(&self, rhs: &Self::Item) -> Result<T>

Source§

fn mul(&self, rhs: &T) -> Result<T>

Source§

fn mul_item(&self, rhs: &Self::Item) -> Result<T>

Source§

fn div_item(&self, rhs: &Self::Item) -> Result<T>

Source§

fn div(&self, rhs: &T) -> Result<T>

Source§

fn dim(&self, dim: i64) -> Result<u64>

Source§

fn sqrt(&self) -> Result<T>
where I: Real,

Source§

fn tanh(&self) -> Result<T>
where I: Real,

Source§

fn neg(&self) -> Result<T>
where I: Neg<Output = I>,

Source§

fn exp(&self) -> Result<T>
where I: Real,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V