[−][src]Struct autograd::tensor::Tensor
Symbolic multi-dimensional array.
Methods
impl<T: Float> Tensor<T>
[src]
pub fn get_persistent_array(&self) -> Option<&NdArray<T>>
[src]
Returns a reference to the persistent array.
Returns Some
if this tensor is made from ag::variable
or ag::constant
.
pub unsafe fn get_persistent_array_mut(&self) -> Option<&mut NdArray<T>>
[src]
Returns a mutable reference to the persistent array.
Returns Some
if this tensor is made from ag::variable
.
pub fn has_persistent_array(&self) -> bool
[src]
Returns True
if this tensor is made from ag::variable
or ag::constant
.
impl<'a, 'b: 'a, 'c: 'a, T: Float + 'b + 'c> Tensor<T>
[src]
pub fn builder() -> TensorBuilder<T>
[src]
pub fn eval<I>(&self, feeds: I) -> Option<NdArray<T>> where
I: IntoIterator<Item = &'a (&'b Tensor<T>, &'c Array<T, IxDyn>)>,
[src]
I: IntoIterator<Item = &'a (&'b Tensor<T>, &'c Array<T, IxDyn>)>,
Evaluates this tensor as an ndarray's array object.
See eval.
pub fn shape(&self) -> Tensor<T>
[src]
Returns the (symbolic) shape of this tensor.
See shape.
pub fn rank(&self) -> Tensor<T>
[src]
Returns the (symbolic) rank of this tensor.
See rank.
pub fn size(&self) -> Tensor<T>
[src]
Returns the (symbolic) size of this tensor.
See size.
impl<T: Float> Tensor<T>
[src]
pub fn get(&self, i: isize) -> Tensor<T>
[src]
Looks up a symbolic element from this tensor.
Index i
can be negative.
extern crate ndarray; extern crate autograd as ag; let ref a = ag::variable(ndarray::arr2(&[[2., 3.], [4., 5.]])); let ref b = a.get(2); assert_eq!(b.eval(&[]).unwrap()[ndarray::IxDyn(&[])], 4.);
Methods from Deref<Target = Rc<TensorCore<T>>>
Trait Implementations
impl<T: Float> ArrayLike<T> for Tensor<T>
[src]
impl<T: Float> Clone for Tensor<T>
[src]
fn clone(&self) -> Tensor<T>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, T: Float> Ord for &'a Tensor<T>
[src]
fn cmp(&self, other: &&'a Tensor<T>) -> Ordering
[src]
Compares the addresses of the two tensors. This can be used for ordering-based data structures (e.g. BinaryTree).
default fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
default fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
default fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T: Float> Eq for Tensor<T>
[src]
impl<'a, T: Float> PartialOrd<&'a Tensor<T>> for &'a Tensor<T>
[src]
fn partial_cmp(&self, other: &&'a Tensor<T>) -> Option<Ordering>
[src]
Compares the addresses of the two tensors. This can be used for ordering-based data structures (e.g. BinaryTree).
#[must_use]
default fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
default fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
default fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
default fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Float> PartialEq<Tensor<T>> for Tensor<T>
[src]
fn eq(&self, other: &Tensor<T>) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T: Float> AsRef<Tensor<T>> for Tensor<T>
[src]
impl<T: Float> Display for Tensor<T>
[src]
impl<T: Float> Debug for Tensor<T>
[src]
impl<T: Float> Add<T> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Self::Output
[src]
impl<'a, T: Float> Add<T> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Self::Output
[src]
impl<T: Float> Add<Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Add<&'a Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Add<Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Add<&'a Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Add<Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Add<&'a Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Add<Tensor<T>> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, 'b, T: Float> Add<&'a Tensor<T>> for &'b Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<T: Float> Sub<T> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Self::Output
[src]
impl<'a, T: Float> Sub<T> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Self::Output
[src]
impl<T: Float> Sub<Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Sub<&'a Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Sub<Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Sub<&'a Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Sub<Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Sub<&'a Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Sub<Tensor<T>> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, 'b, T: Float> Sub<&'a Tensor<T>> for &'b Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<T: Float> Mul<T> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self::Output
[src]
impl<'a, T: Float> Mul<T> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self::Output
[src]
impl<T: Float> Mul<Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Mul<&'a Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Mul<Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Mul<&'a Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Mul<Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Mul<&'a Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Mul<Tensor<T>> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, 'b, T: Float> Mul<&'a Tensor<T>> for &'b Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<T: Float> Div<T> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output
[src]
impl<'a, T: Float> Div<T> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output
[src]
impl<T: Float> Div<Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Div<&'a Tensor<T>> for f64
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Div<Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Div<&'a Tensor<T>> for f32
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &'a Tensor<T>) -> Self::Output
[src]
impl<T: Float> Div<Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Div<&'a Tensor<T>> for Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<'a, T: Float> Div<Tensor<T>> for &'a Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Tensor<T>) -> Self::Output
[src]
impl<'a, 'b, T: Float> Div<&'a Tensor<T>> for &'b Tensor<T>
[src]
type Output = Tensor<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &Tensor<T>) -> Self::Output
[src]
impl<T: Float> Deref for Tensor<T>
[src]
type Target = Rc<TensorCore<T>>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<T: Float> DerefMut for Tensor<T>
[src]
fn deref_mut<'a>(&'a mut self) -> &'a mut Rc<TensorCore<T>>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
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> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,