[][src]Struct auto_diff::tensor::Tensor

pub struct Tensor { /* fields omitted */ }

Methods

impl Tensor[src]

pub fn new() -> Tensor[src]

pub fn is_empty() -> bool[src]

pub fn size(&self) -> Vec<usize>[src]

Returns the size of the self tensor. The returned value is a Vec..

pub fn from_vec_f32(input: &Vec<f32>, dim: &Vec<usize>) -> Tensor[src]

Create a tensor from a Vec,

let t1 = Tensor::from_vec_f32(&vec![0., 1., 2., 4.,], &vec![2,2]);

pub fn to_vec_f32(&mut self) -> Vec<f32>[src]

pub fn from_vec_f64(i: &Vec<f64>) -> Tensor[src]

pub fn fill(size: &Vec<usize>, fill_value: f32) -> Tensor[src]

Returns a tensor of size size filled with fill_value.

pub fn fill_like() -> Tensor[src]

pub fn empty() -> Tensor[src]

pub fn new_ones(dim: &Vec<u32>) -> Tensor[src]

pub fn new_zeros(dim: &Vec<u32>) -> Tensor[src]

pub fn zeros_like(o: &Tensor) -> Tensor[src]

pub fn ones_like(o: &Tensor) -> Tensor[src]

pub fn range(start: f64, step: f64) -> Tensor[src]

pub fn linespace(start: f64, end: f64, steps: u32) -> Tensor[src]

pub fn logspace(start: f64, end: f64, steps: u32, base: f64) -> Tensor[src]

pub fn eye(n: u32, m: u32) -> Tensor[src]

pub fn cat()[src]

pub fn chunk()[src]

pub fn gather()[src]

pub fn index_select()[src]

pub fn masked_select()[src]

pub fn narrow()[src]

pub fn nonzero()[src]

pub fn reshape()[src]

pub fn split()[src]

pub fn squeeze()[src]

pub fn stack()[src]

pub fn t()[src]

pub fn take()[src]

pub fn transpose()[src]

pub fn unbind()[src]

pub fn unsqueeze()[src]

pub fn condition()[src]

pub fn to_f64(&mut self)[src]

pub fn to_f32(&mut self)[src]

pub fn add(&self, o: &Tensor) -> Tensor[src]

pub fn sub(&self, o: &Tensor) -> Tensor[src]

pub fn mul(&self, o: &Tensor) -> Tensor[src]

pub fn div(&self, o: &Tensor) -> Tensor[src]

pub fn mm(&self, o: &Tensor) -> Tensor[src]

pub fn matmul(&self, o: &Tensor) -> Tensor[src]

Trait Implementations

impl Display for Tensor[src]

Auto Trait Implementations

impl RefUnwindSafe for Tensor

impl Send for Tensor

impl Sync for Tensor

impl Unpin for Tensor

impl UnwindSafe for Tensor

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> 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.