pub struct CsrTensor<B: SparseOps> { /* private fields */ }Available on crate feature
api only.Implementations§
Source§impl<B: SparseOps> CsrTensor<B>
impl<B: SparseOps> CsrTensor<B>
pub fn from_data( data: &B::CsrData, device: &B::Device, ) -> Result<Self, B::SparseError>
pub fn from_handle(handle: B::CsrHandle) -> Self
pub fn from_parts( handle: B::CsrHandle, values: Tensor<B, 1>, ) -> Result<Self, B::SparseError>
pub fn into_parts(self) -> (B::CsrHandle, Tensor<B, 1>)
pub fn shape(&self) -> [usize; 2]
pub fn values(&self) -> Tensor<B, 1>
pub fn device(&self) -> B::Device
pub fn to_device(&self, device: &B::Device) -> Self
pub async fn to_data(&self) -> Result<B::CsrData, B::SparseError>
pub fn with_values(&self, values: Tensor<B, 1>) -> Result<Self, B::SparseError>
pub fn matmul(&self, rhs: Tensor<B, 2>) -> Result<Tensor<B, 2>, B::SparseError>
pub fn gather( &self, dense: Tensor<B, 2>, ) -> Result<Tensor<B, 1>, B::SparseError>
pub fn scatter_add(&self) -> Result<Tensor<B, 2>, B::SparseError>
pub fn mul_dense(&self, rhs: Tensor<B, 2>) -> Result<Self, B::SparseError>
pub fn to_dense(&self) -> Result<Tensor<B, 2>, B::SparseError>
pub fn transpose_matmul( &self, rhs: Tensor<B, 2>, ) -> Result<Tensor<B, 2>, B::SparseError>
pub fn transpose(&self) -> Result<Self, B::SparseError>
pub fn add(&self, rhs: &Self) -> Result<Self, B::SparseError>
pub fn sparse_matmul(&self, rhs: &Self) -> Result<Self, B::SparseError>
pub fn sampled_sparse_matmul( &self, lhs: &Self, rhs: &Self, ) -> Result<Self, B::SparseError>
pub fn add_scaled( &self, rhs: &Self, alpha: f32, beta: f32, ) -> Result<Self, B::SparseError>
pub fn sampled_matmul( &self, lhs: Tensor<B, 2>, rhs: Tensor<B, 2>, ) -> Result<Self, B::SparseError>
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for CsrTensor<B>
impl<B> RefUnwindSafe for CsrTensor<B>
impl<B> Send for CsrTensor<B>
impl<B> Sync for CsrTensor<B>
impl<B> Unpin for CsrTensor<B>
impl<B> UnsafeUnpin for CsrTensor<B>
impl<B> UnwindSafe for CsrTensor<B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more