[][src]Struct l2::tensor::Tensor

pub struct Tensor<'a> {
    pub data: Vec<f32>,
    pub shape: Vec<usize>,
    pub strides: Vec<usize>,
    // some fields omitted
}

Fields

data: Vec<f32>shape: Vec<usize>strides: Vec<usize>

Implementations

impl<'a> Tensor<'a>[src]

pub fn new<'b>(
    data: Vec<f32>,
    shape: &[usize]
) -> Result<Tensor<'b>, TensorError>
[src]

pub fn new_no_grad<'b>(
    data: Vec<f32>,
    shape: &[usize]
) -> Result<Tensor<'b>, TensorError>
[src]

pub fn zeros<'b>(shape: &[usize]) -> Result<Tensor<'b>, TensorError>[src]

pub fn normal<'b>(
    shape: &[usize],
    mean: f32,
    std: f32
) -> Result<Tensor<'b>, TensorError>
[src]

pub fn uniform<'b>(
    shape: &[usize],
    low: f32,
    high: f32
) -> Result<Tensor<'b>, TensorError>
[src]

pub fn slice(
    &'a self,
    logical_indices: &[[isize; 2]]
) -> Result<Self, TensorError>
[src]

pub fn view(&'a self, shape: &[isize]) -> Result<Self, TensorError>[src]

pub fn pow(&self, exp: f32) -> Result<Tensor, TensorError>[src]

pub fn sqrt(&self) -> Result<Tensor, TensorError>[src]

pub fn exp(&self) -> Result<Tensor, TensorError>[src]

pub fn log10(&self) -> Result<Tensor, TensorError>[src]

pub fn log(&self) -> Result<Tensor, TensorError>[src]

pub fn abs(&self) -> Result<Tensor, TensorError>[src]

pub fn sin(&self) -> Result<Tensor, TensorError>[src]

pub fn cos(&self) -> Result<Tensor, TensorError>[src]

pub fn tan(&self) -> Result<Tensor, TensorError>[src]

pub fn sum(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn mean(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn max(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn min(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn argmax(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn argmin(&self, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn matmul(&'a self, rhs: &'a Tensor) -> Result<Tensor, TensorError>[src]

pub fn concat(&self, rhs: &'a Tensor, dim: isize) -> Result<Tensor, TensorError>[src]

pub fn transpose(&self) -> Result<Tensor, TensorError>[src]

pub fn clone_no_grad(&self) -> Result<Tensor, TensorError>[src]

pub fn backward(&self)[src]

pub fn clear(&self)[src]

Trait Implementations

impl<'a> Add<&'a Tensor<'a>> for &'a Tensor<'a>[src]

type Output = Tensor<'a>

The resulting type after applying the + operator.

impl<'a> Clone for Tensor<'a>[src]

impl<'a> Debug for Tensor<'a>[src]

impl<'a> Display for Tensor<'a>[src]

impl<'a> Div<&'a Tensor<'a>> for &'a Tensor<'a>[src]

type Output = Tensor<'a>

The resulting type after applying the / operator.

impl<'a> Mul<&'a Tensor<'a>> for &'a Tensor<'a>[src]

type Output = Tensor<'a>

The resulting type after applying the * operator.

impl<'a> PartialEq<Tensor<'a>> for Tensor<'a>[src]

impl<'a> StructuralPartialEq for Tensor<'a>[src]

impl<'a> Sub<&'a Tensor<'a>> for &'a Tensor<'a>[src]

type Output = Tensor<'a>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Tensor<'a>

impl<'a> !Send for Tensor<'a>

impl<'a> !Sync for Tensor<'a>

impl<'a> Unpin for Tensor<'a>

impl<'a> !UnwindSafe for Tensor<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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