[][src]Struct tensor_compute::GpuTensorView

pub struct GpuTensorView<'a> {
    pub shape_strides: ShapeStrides,
    // some fields omitted
}

A GpuTensorView share the same data as the original Tensor, but can have different shapes and strides For example, the original shape could be [2, 2] and the GpuTensorView could be [1, 2, 2]

Fields

shape_strides: ShapeStrides

Implementations

impl<'a> GpuTensorView<'a>[src]

Used to temporarily modify how the underlying tensor data is interpreted, by changing the tensor shape or strides for example

pub fn from_tensor(gpu_tensor: &'a GpuTensor, dim_strides: ShapeStrides) -> Self[src]

pub async fn to_tensor<'_>(&'_ self) -> GpuTensor[src]

pub fn slice<T: Into<SliceRangeInfo>>(
    &self,
    bounds: Vec<T>
) -> GpuTensorView<'_>
[src]

pub fn buffer_size_in_bytes(&self) -> usize[src]

pub fn shape(&self) -> &VecDeque<usize>[src]

pub fn strides(&self) -> &VecDeque<usize>[src]

pub fn dim_strides(&self) -> &ShapeStrides[src]

impl<'a> GpuTensorView<'a>[src]

pub async fn contiguous<'_>(&'_ self) -> GpuTensor[src]

pub async fn eq<'_, '_>(&'_ self, other: &'_ Self) -> bool[src]

Trait Implementations

impl<'a> AsShaderInput for GpuTensorView<'a>[src]

impl<'a> GpuAllocated for GpuTensorView<'a>[src]

impl<'a> MutShapeStrideTrait for GpuTensorView<'a>[src]

impl<'a> ShapeStrideTrait for GpuTensorView<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for GpuTensorView<'a>

impl<'a> Send for GpuTensorView<'a>

impl<'a> Sync for GpuTensorView<'a>

impl<'a> Unpin for GpuTensorView<'a>

impl<'a> !UnwindSafe for GpuTensorView<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,