[−][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]
pub fn new(dims: &[u64]) -> Self
[src]
Creates a new tensor.
The data is initialized to zeros.
pub fn with_values(self, value: &[T]) -> Result<Self>
[src]
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]
Returns the tensor's dimensions.
Trait Implementations
impl<T: Clone + TensorType> Clone for Tensor<T> where
T::InnerType: Clone,
[src]
T::InnerType: Clone,
fn clone(&self) -> Tensor<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: TensorType + PartialEq> PartialEq<Tensor<T>> for Tensor<T>
[src]
fn eq(&self, other: &Tensor<T>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl<T: Eq + TensorType> Eq for Tensor<T> where
T::InnerType: Eq,
[src]
T::InnerType: Eq,
impl<T: TensorType> From<T> for Tensor<T>
[src]
impl<'a, T: TensorType> From<&'a [T]> for Tensor<T>
[src]
impl<T: TensorType> Deref for Tensor<T>
[src]
impl<T: TensorType> DerefMut for Tensor<T>
[src]
impl<T: Debug + TensorType> Debug for Tensor<T> where
T::InnerType: Debug,
[src]
T::InnerType: Debug,
impl<T: TensorType> Display for Tensor<T>
[src]
Auto Trait Implementations
impl<T> Send for Tensor<T> where
<T as TensorType>::InnerType: Send,
<T as TensorType>::InnerType: Send,
impl<T> Sync for Tensor<T> where
<T as TensorType>::InnerType: Sync,
<T as TensorType>::InnerType: Sync,
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,