[−][src]Struct tensor_compute::GpuTensorView
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]
&self,
bounds: Vec<T>
) -> GpuTensorView<'_>
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]
fn to_shader_inputs(&self, binding_offset: usize) -> Vec<ShaderInput<'_>>
[src]
impl<'a> GpuAllocated for GpuTensorView<'a>
[src]
fn get_gpu(&self) -> &'static GpuInstance
[src]
fn internal_gpu_buffer(&self) -> &GpuBuffer
[src]
fn internal_buffer_size_in_bytes(&self) -> usize
[src]
impl<'a> MutShapeStrideTrait for GpuTensorView<'a>
[src]
fn increase_rank(&mut self)
[src]
fn decrease_rank(&mut self)
[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]
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,
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, 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.
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.
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>,