[−][src]Struct tensorflow::Tensor
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]
impl<T: TensorType> Tensor<T>pub fn new(dims: &[u64]) -> Self[src]
pub fn new(dims: &[u64]) -> SelfCreates a new tensor.
The data is initialized to zeros.
pub fn with_values(self, value: &[T]) -> Result<Self>[src]
pub fn with_values(self, value: &[T]) -> Result<Self>Sets (copies) the tensor values to the provided ones.
let a = Tensor::new(&[2, 2]).with_values(&[0_i32, 1, 2, 3]).unwrap();
pub fn dims(&self) -> &[u64][src]
pub fn dims(&self) -> &[u64]Returns the tensor's dimensions.
Trait Implementations
impl<T: TensorType> From<T> for Tensor<T>[src]
impl<T: TensorType> From<T> for Tensor<T>impl<'a, T: TensorType> From<&'a [T]> for Tensor<T>[src]
impl<'a, T: TensorType> From<&'a [T]> for Tensor<T>impl<T: Eq + TensorType> Eq for Tensor<T> where
T::InnerType: Eq, [src]
impl<T: Eq + TensorType> Eq for Tensor<T> where
T::InnerType: Eq, impl<T: TensorType + PartialEq> PartialEq<Tensor<T>> for Tensor<T>[src]
impl<T: TensorType + PartialEq> PartialEq<Tensor<T>> for Tensor<T>fn eq(&self, other: &Tensor<T>) -> bool[src]
fn eq(&self, other: &Tensor<T>) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0
[src]This method tests for !=.
impl<T: Clone + TensorType> Clone for Tensor<T> where
T::InnerType: Clone, [src]
impl<T: Clone + TensorType> Clone for Tensor<T> where
T::InnerType: Clone, fn clone(&self) -> Tensor<T>[src]
fn clone(&self) -> Tensor<T>fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl<T: Debug + TensorType> Debug for Tensor<T> where
T::InnerType: Debug, [src]
impl<T: Debug + TensorType> Debug for Tensor<T> where
T::InnerType: Debug, impl<T: TensorType> Display for Tensor<T>[src]
impl<T: TensorType> Display for Tensor<T>impl<T: TensorType> Deref for Tensor<T>[src]
impl<T: TensorType> Deref for Tensor<T>impl<T: TensorType> DerefMut for Tensor<T>[src]
impl<T: TensorType> DerefMut for Tensor<T>Auto Trait Implementations
impl<T> Send for Tensor<T> where
<T as TensorType>::InnerType: Send,
impl<T> Send for Tensor<T> where
<T as TensorType>::InnerType: Send, impl<T> Sync for Tensor<T> where
<T as TensorType>::InnerType: Sync,
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, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>,