[][src]Struct ndarray_tensorflow::NdTensor

pub struct NdTensor<T, D> where
    T: TensorType
{ /* fields omitted */ }

A wrapper for Tensor that provides views.

A Tensorflow Tensor only provides a limited API. This type is a wrapper around Tensor that makes it possible to use a tensor as an ArrayView or ArrayViewMut from the ndarray crate.

Methods

impl<T, D> NdTensor<T, D> where
    T: TensorType,
    D: Dimension
[src]

pub fn from_tensor(tensor: Tensor<T>) -> Result<Self, ShapeError>[src]

Construct an ArrayTensor from a Tensor.

This function will return Err when the shape is incompatible with the shape type.

pub fn zeros<I>(shape: I) -> Self where
    I: IntoDimension<Dim = D>, 
[src]

Construct a new zero-initialized wrapped Tensor with the given shape.

pub fn inner_ref(&self) -> &Tensor<T>[src]

Get reference to the wrapped tensor.

pub fn into_inner(self) -> Tensor<T>[src]

Convert into the wrapped tensor.

pub fn view(&self) -> ArrayView<T, D>[src]

Get a view of the tensor.

pub fn view_mut(&mut self) -> ArrayViewMut<T, D>[src]

Get a mutable view of the tensor.

Trait Implementations

impl<'a, T, D> Into<ArrayBase<ViewRepr<&'a T>, D>> for &'a NdTensor<T, D> where
    T: TensorType,
    D: Dimension
[src]

impl<'a, T, D> Into<ArrayBase<ViewRepr<&'a mut T>, D>> for &'a mut NdTensor<T, D> where
    T: TensorType,
    D: Dimension
[src]

Auto Trait Implementations

impl<T, D> Send for NdTensor<T, D> where
    D: Send,
    <T as TensorType>::InnerType: Send

impl<T, D> Sync for NdTensor<T, D> where
    D: Sync,
    <T as TensorType>::InnerType: Sync

Blanket Implementations

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

impl<T> From<T> for T[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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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