[][src]Struct tensorflow::Tensor

pub struct Tensor<T: TensorType> { /* fields omitted */ }

Holds a multi-dimensional array of elements of a single data type.

The data buffer stores elements in row major order. E.g. if data is treated as a vector of T:

  element 0:   index (0, ..., 0)
  element 1:   index (0, ..., 1)
  ...

Methods

impl<T: TensorType> Tensor<T>
[src]

Creates a new tensor.

The data is initialized to zeros.

Sets (copies) the tensor values to the provided ones.

let a = Tensor::new(&[2, 2]).with_values(&[0_i32, 1, 2, 3]).unwrap();

Returns the tensor's dimensions.

Trait Implementations

impl<T: TensorType + PartialEq> PartialEq<Tensor<T>> for Tensor<T>
[src]

This method tests for !=.

impl<T: TensorType> From<T> for Tensor<T>
[src]

impl<'a, T: TensorType> From<&'a [T]> for Tensor<T>
[src]

impl<T: Clone + TensorType> Clone for Tensor<T> where
    T::InnerType: Clone
[src]

Performs copy-assignment from source. Read more

impl<T: Eq + TensorType> Eq for Tensor<T> where
    T::InnerType: Eq
[src]

impl<T: TensorType> Display for Tensor<T>
[src]

impl<T: Debug + TensorType> Debug for Tensor<T> where
    T::InnerType: Debug
[src]

impl<T: TensorType> Deref for Tensor<T>
[src]

The resulting type after dereferencing.

impl<T: TensorType> DerefMut for Tensor<T>
[src]

Auto Trait Implementations

impl<T> Send for Tensor<T> where
    <T as TensorType>::InnerType: Send

impl<T> Sync for Tensor<T> where
    <T as TensorType>::InnerType: Sync

Blanket Implementations

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

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

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

impl<T> From for T
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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