[][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]

pub fn numel(&self) -> usize[src]

pub fn get_scale_f32(&self) -> f32[src]

pub fn get_N(&self) -> Tensor[src]

pub fn get_C(&self) -> Tensor[src]

pub fn get_D(&self) -> Tensor[src]

pub fn get_H(&self) -> Tensor[src]

pub fn get_W(&self) -> Tensor[src]

pub fn numel_tensor(&self) -> Tensor[src]

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

pub fn from_vec_f32(input: &[f32], dim: &[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: &[f64]) -> Tensor[src]

pub fn swap(&self, o: Tensor)[src]

pub fn fill(size: &[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: &[u32]) -> Tensor[src]

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

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

pub fn ones_like(&self) -> 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 permute(&self, dim: &[usize]) -> Tensor[src]

pub fn unsqueeze(&mut self, dim: &[usize]) -> &Tensor[src]

Returns a new tensor with a dimension of size one inserted at the specified position.

The returned tensor shares the same underlying data with this tensor.

pub fn condition()[src]

pub fn to_f64(&mut self)[src]

pub fn to_f32(&mut self)[src]

pub fn neg(&self) -> Tensor[src]

pub fn log1pexp(&self) -> Tensor[src]

pub fn sigmoid(&self) -> Tensor[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]

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

pub fn mean(&self, dim: usize, keepdim: bool) -> Tensor[src]

pub fn sum(&self) -> Tensor[src]

Trait Implementations

impl Clone for Tensor[src]

impl Debug for Tensor[src]

impl Display for Tensor[src]

impl Eq for Tensor[src]

impl PartialEq<Tensor> 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> 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>,