[−][src]Struct tensor_compute::GpuTensor
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]
gpu: &GpuInstance,
data: Vec<f32>,
shape: Vec<usize>
) -> Self
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]
buffer: GpuBuffer,
shape: VecDeque<usize>,
strides: VecDeque<usize>,
offset: usize
) -> Self
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]
&self,
bounds: Vec<T>
) -> GpuTensorView<'_>
pub async fn assign<T: Into<SliceRangeInfo>, '_>(
&'_ mut self,
bounds: Vec<T>,
value: f32
)
[src]
&'_ mut self,
bounds: Vec<T>,
value: f32
)
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]
&'a self,
other: &'a Self,
skipping_dims: Option<usize>
) -> Option<(GpuTensorView<'a>, GpuTensorView<'a>)>
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]
fn get_gpu(&self) -> &'static GpuInstance
[src]
fn internal_gpu_buffer(&self) -> &GpuBuffer
[src]
fn internal_buffer_size_in_bytes(&self) -> usize
[src]
impl MutShapeStrideTrait for GpuTensor
[src]
fn increase_rank(&mut self)
[src]
fn decrease_rank(&mut self)
[src]
impl ShapeStrideTrait for GpuTensor
[src]
Auto Trait Implementations
impl !RefUnwindSafe for GpuTensor
impl Send for GpuTensor
impl Sync for GpuTensor
impl Unpin for GpuTensor
impl !UnwindSafe for GpuTensor
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>,