[−][src]Trait tension::Tensor
Tensor a.k.a. N-dimensional array.
Associated Types
Loading content...Required methods
unsafe fn new_uninit_in(
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape
) -> Self
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape
) -> Self
Create unitialized tensor
fn new_filled_in(
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape,
value: T
) -> Self
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape,
value: T
) -> Self
Create tensor filled with value on the specified hardware
fn new_zeroed_in(
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape
) -> Self
context: &<Self::Buffer as Buffer<T>>::Context,
shape: &Shape
) -> Self
Create tensor filled with zeros on the specified hardware
fn shape(&self) -> &Shape
Shape of the tensor - a slice containing all tensor dimensions.
fn reshape(&self, shape: &Shape) -> Self
Returns a new tensor that shares the same data but has other shape. Failed if the product of all shape dimensions is not equal to buffer size.
fn load(&self, dst: &mut [T])
Load flattened data from tensor to slice.
fn store(&mut self, src: &[T])
Store data from slice to a tensor in a flattened manner.