pub struct Tensor<T> { /* private fields */ }Expand description
Intended to be generic over various arthimetic types, currently only support f64. Tensor are contructed using either dense or sparse representations. In addition to the represenetation, a tensor also has a shape, which is a list of indices that define the dimensions of the tensor. Tensor data can be loaded from a file, can be filled with a constant value, or can be randomly initialized. Note that the eDSL is not pure rust, so this documentation serves to capture the functionality as best as possible with in the bounds of the Rust language
Implementations§
Source§impl<T: Default> Tensor<T>
impl<T: Default> Tensor<T>
Sourcepub fn dense(_index_list: &[Index]) -> Tensor<T>
pub fn dense(_index_list: &[Index]) -> Tensor<T>
creates a dense representation of a tensor with shape defined by the array of indicies
Sourcepub fn csr(_index_list: &[Index]) -> Tensor<T>
pub fn csr(_index_list: &[Index]) -> Tensor<T>
creates a csr representation of a tensor with shape defined by the array of indicies
Sourcepub fn dcsr(_index_list: &[Index]) -> Tensor<T>
pub fn dcsr(_index_list: &[Index]) -> Tensor<T>
creates a dcsr representation of a tensor with shape defined by the array of indicies
Sourcepub fn coo(_index_list: &[Index]) -> Tensor<T>
pub fn coo(_index_list: &[Index]) -> Tensor<T>
creates a coo representation of a tensor with shape defined by the array of indicies
Sourcepub fn csf(_index_list: &[Index]) -> Tensor<T>
pub fn csf(_index_list: &[Index]) -> Tensor<T>
creates a csf representation of a tensor with shape defined by the array of indicies
Sourcepub fn fill(&mut self, _val: T)
pub fn fill(&mut self, _val: T)
populate a tensor with a constant value. Currently only valid for dense tensors
Sourcepub fn fill_from_file(&mut self, _filename: &str)
pub fn fill_from_file(&mut self, _filename: &str)
load a tensor from a file. Currently only valid for sparse tensors