[−][src]Struct math::tensor::Tensor
An N-dimensional Tensor
Examples
use math::tensor::{IntoTensor, ShapableData}; let tensor = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into_tensor([3, 4]); assert_eq!(tensor.shape().ndim(), 2); assert_eq!(tensor.shape().dims(), vec![3, 4]);
Trait Implementations
impl<Dtype: Clone> Clone for Tensor<Dtype>
[src]
impl<Dtype: Debug> Debug for Tensor<Dtype>
[src]
impl<Dtype: Eq> Eq for Tensor<Dtype>
[src]
impl<'a, Dtype> From<&'a Tensor<Dtype>> for EphemeralView<'a, Dtype>
[src]
A Tensor can be viewed as an EphemeralView with the same shape.
impl<Dtype: PartialEq> PartialEq<Tensor<Dtype>> for Tensor<Dtype>
[src]
pub fn eq(&self, other: &Tensor<Dtype>) -> bool
[src]
pub fn ne(&self, other: &Tensor<Dtype>) -> bool
[src]
impl<Dtype> ShapableData<Dtype> for Tensor<Dtype>
[src]
A Tensor provides an interface for the underlying data and shape.
pub fn data(&self) -> &Vec<Dtype>
[src]
pub fn shape(&self) -> &TensorShape
[src]
pub fn shape_mut(&mut self) -> &mut TensorShape
[src]
pub fn t(&self) -> EphemeralView<'_, Dtype>
[src]
pub fn transpose(&self, axes: Vec<AxisIndex>) -> EphemeralView<'_, Dtype>
[src]
impl<Dtype> StructuralEq for Tensor<Dtype>
[src]
impl<Dtype> StructuralPartialEq for Tensor<Dtype>
[src]
impl<'a, Dtype> ToIterator<'a, TensorIter<'a, Dtype>, Dtype> for Tensor<Dtype> where
Dtype: Copy,
[src]
Dtype: Copy,
pub fn to_iter(&'a self) -> TensorIter<'a, Dtype>ⓘNotable traits for TensorIter<'a, Dtype>
impl<'a, Dtype> Iterator for TensorIter<'a, Dtype> where
Dtype: Copy, type Item = Dtype;
[src]
Notable traits for TensorIter<'a, Dtype>
impl<'a, Dtype> Iterator for TensorIter<'a, Dtype> where
Dtype: Copy, type Item = Dtype;
impl<'a, Dtype> ToView<'a, Dtype> for Tensor<Dtype>
[src]
pub fn as_shape<S: Into<TensorShape>>(
&'a self,
shape: S
) -> EphemeralView<'a, Dtype>
[src]
&'a self,
shape: S
) -> EphemeralView<'a, Dtype>
Auto Trait Implementations
impl<Dtype> RefUnwindSafe for Tensor<Dtype> where
Dtype: RefUnwindSafe,
[src]
Dtype: RefUnwindSafe,
impl<Dtype> Send for Tensor<Dtype> where
Dtype: Send,
[src]
Dtype: Send,
impl<Dtype> Sync for Tensor<Dtype> where
Dtype: Sync,
[src]
Dtype: Sync,
impl<Dtype> Unpin for Tensor<Dtype> where
Dtype: Unpin,
[src]
Dtype: Unpin,
impl<Dtype> UnwindSafe for Tensor<Dtype> where
Dtype: UnwindSafe,
[src]
Dtype: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,