[][src]Struct tensor_compute::GpuTensor

pub struct GpuTensor { /* fields omitted */ }

Implementations

impl GpuTensor[src]

pub async fn uninitialized(shape: Vec<usize>) -> GpuTensor[src]

pub async fn new_filled(shape: Vec<usize>, fill_val: f32) -> GpuTensor[src]

pub fn from_data_with_gpu(
    gpu: &GpuInstance,
    data: Vec<f32>,
    shape: Vec<usize>
) -> Self
[src]

pub fn from_buffer(buffer: GpuBuffer, shape: VecDeque<usize>) -> Self[src]

pub fn from_buffer_with_strides_and_offset(
    buffer: GpuBuffer,
    shape: VecDeque<usize>,
    strides: VecDeque<usize>,
    offset: usize
) -> Self
[src]

pub fn from(data: Vec<f32>, shape: Vec<usize>) -> Self[src]

pub fn from_data_1d(data: Vec<f32>) -> Self[src]

pub fn from_scalar(data: f32) -> Self[src]

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

pub fn is_scalar(&self) -> bool[src]

pub fn is_empty(&self) -> bool[src]

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

pub async fn assign<T: Into<SliceRangeInfo>, '_>(
    &'_ mut self,
    bounds: Vec<T>,
    value: f32
)
[src]

impl GpuTensor[src]

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

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

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

pub async fn leaky_relu<'_>(&'_ self, leakage: f32) -> GpuTensor[src]

pub async fn fill_with<'_>(&'_ mut self, value: f32)[src]

pub async fn matmul<'a>(&'a self, other: &'a Self) -> Self[src]

impl GpuTensor[src]

pub fn view(&self) -> GpuTensorView<'_>[src]

pub fn reshape(&mut self, shape: Vec<usize>)[src]

pub fn broadcast<'a>(
    &'a self,
    other: &'a Self,
    skipping_dims: Option<usize>
) -> Option<(GpuTensorView<'a>, GpuTensorView<'a>)>
[src]

Tensor are broadcastable if:

  • Each tensor has at least one dimension.
  • When iterating over the dimension sizes, starting at the trailing dimension, the dimension sizes must either be equal, one of them is 1, or one of them does not exist.

The broadcasting rules are: If the number of dimensions of x and y are not equal, prepend 1 to the dimensions of the tensor with fewer dimensions to make them equal length. Then, for each dimension size, the resulting dimension size is the max of the sizes of x and y along that dimension.

Trait Implementations

impl Debug for GpuTensor[src]

impl GpuAllocated for GpuTensor[src]

impl MutShapeStrideTrait for GpuTensor[src]

impl ShapeStrideTrait for GpuTensor[src]

Auto Trait Implementations

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>,