Skip to main content

CsrTensor

Struct CsrTensor 

Source
pub struct CsrTensor<B: SparseOps> { /* private fields */ }
Available on crate feature api only.

Implementations§

Source§

impl<B: SparseOps> CsrTensor<B>

Source

pub fn from_data( data: &B::CsrData, device: &B::Device, ) -> Result<Self, B::SparseError>

Source

pub fn from_handle(handle: B::CsrHandle) -> Self

Source

pub fn from_parts( handle: B::CsrHandle, values: Tensor<B, 1>, ) -> Result<Self, B::SparseError>

Source

pub fn into_parts(self) -> (B::CsrHandle, Tensor<B, 1>)

Source

pub fn shape(&self) -> [usize; 2]

Source

pub fn values(&self) -> Tensor<B, 1>

Source

pub fn device(&self) -> B::Device

Source

pub fn to_device(&self, device: &B::Device) -> Self

Source

pub async fn to_data(&self) -> Result<B::CsrData, B::SparseError>

Source

pub fn with_values(&self, values: Tensor<B, 1>) -> Result<Self, B::SparseError>

Source

pub fn matmul(&self, rhs: Tensor<B, 2>) -> Result<Tensor<B, 2>, B::SparseError>

Source

pub fn gather( &self, dense: Tensor<B, 2>, ) -> Result<Tensor<B, 1>, B::SparseError>

Source

pub fn scatter_add(&self) -> Result<Tensor<B, 2>, B::SparseError>

Source

pub fn mul_dense(&self, rhs: Tensor<B, 2>) -> Result<Self, B::SparseError>

Source

pub fn to_dense(&self) -> Result<Tensor<B, 2>, B::SparseError>

Source

pub fn transpose_matmul( &self, rhs: Tensor<B, 2>, ) -> Result<Tensor<B, 2>, B::SparseError>

Source

pub fn transpose(&self) -> Result<Self, B::SparseError>

Source

pub fn add(&self, rhs: &Self) -> Result<Self, B::SparseError>

Source

pub fn sparse_matmul(&self, rhs: &Self) -> Result<Self, B::SparseError>

Source

pub fn sampled_sparse_matmul( &self, lhs: &Self, rhs: &Self, ) -> Result<Self, B::SparseError>

Source

pub fn add_scaled( &self, rhs: &Self, alpha: f32, beta: f32, ) -> Result<Self, B::SparseError>

Source

pub fn sampled_matmul( &self, lhs: Tensor<B, 2>, rhs: Tensor<B, 2>, ) -> Result<Self, B::SparseError>

Trait Implementations§

Source§

impl<B: Clone + SparseOps> Clone for CsrTensor<B>
where B::CsrHandle: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Debug + SparseOps> Debug for CsrTensor<B>
where B::CsrHandle: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> Freeze for CsrTensor<B>
where <B as SparseOps>::CsrHandle: Freeze, Tensor<B, 1>: Freeze,

§

impl<B> RefUnwindSafe for CsrTensor<B>

§

impl<B> Send for CsrTensor<B>
where <B as SparseOps>::CsrHandle: Send, Tensor<B, 1>: Send,

§

impl<B> Sync for CsrTensor<B>
where <B as SparseOps>::CsrHandle: Sync, Tensor<B, 1>: Sync,

§

impl<B> Unpin for CsrTensor<B>
where <B as SparseOps>::CsrHandle: Unpin, Tensor<B, 1>: Unpin,

§

impl<B> UnsafeUnpin for CsrTensor<B>

§

impl<B> UnwindSafe for CsrTensor<B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.