[−][src]Struct ndarray_tensorflow::NdTensor
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]
T: TensorType,
D: Dimension,
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]
I: IntoDimension<Dim = D>,
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]
T: TensorType,
D: Dimension,
impl<'a, T, D> Into<ArrayBase<ViewRepr<&'a mut T>, D>> for &'a mut NdTensor<T, D> where
T: TensorType,
D: Dimension,
[src]
T: TensorType,
D: Dimension,
fn into(self) -> ArrayViewMut<'a, T, D>
[src]
impl<T, D> TryFrom<Tensor<T>> for NdTensor<T, D> where
T: TensorType,
D: Dimension,
[src]
T: TensorType,
D: Dimension,
Auto Trait Implementations
impl<T, D> Send for NdTensor<T, D> where
D: Send,
<T as TensorType>::InnerType: Send,
D: Send,
<T as TensorType>::InnerType: Send,
impl<T, D> Sync for NdTensor<T, D> where
D: Sync,
<T as TensorType>::InnerType: Sync,
D: Sync,
<T as TensorType>::InnerType: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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, 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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,