Expand description
§API document of rstsr-core
rstsr-core
is the core of RSTSR series:
- It defines data structure and some traits (interface) of tensor, storage, device.
- It realizes two basic devices:
DeviceCpuSerial
andDeviceFaer
, sorstsr-core
alone is a functional tensor toolkit library.
If you are more aware of matmul efficiency, or by other considerations (we will try to implement BLAS and Lapack features in future), you may find DeviceOpenBLAS
in rstsr-openblas
helpful. We hope to implement more devices in future.
§User document
User document refers to readthedocs. This document is still in construction.
§API specifications
API specifications is provided for summary of important identifiers (structs, traits and functions) in rstsr-core
.
Currently, more detailed documentation for each identifiers are still constructing.
We also provide fullfillment for Array API standard. This fullfillment check shows how much functionalities we have achieved to be a basic tensor (array) library.
For NumPy users, in this meantime, fullfillment for Array API standard shows the similar parts of RSTSR and NumPy; and these parts in API specifications shows the difference between RSTSR and NumPy:
- Tensor Structure and Ownership
- RSTSR Specific Identifiers
- Storage-dependent manuplication
- Developer Area
§Variable naming convention
§Abbreviations of type annotations
Abbreviation | Meaning |
---|---|
TR | Tensor type (struct TensorBase ) |
T | Data type (can be f64 , Complex<f32> , etc) |
B | Backend (device) type (applies DeviceAPI ) |
D | Dimensional (applies DimAPI ) |
S | Storage (struct storage::Storage ) |
R | Data with lifetime and mutability (applies DataCloneAPI ) |
C | Content (usually Vec<T> for CPU devices) |
§Variable or Names
Rule | Convention |
---|---|
suffix API | Traits. To avoid naming collision with structs or other crates. Example: DeviceAPI , AsArrayAPI |
suffix _f | Fallible functions. Those functions pairs with a function that panics when error. Example: zeros_f , sin_f , reshape_f |
prefix to_ or no prefix (manuplication functions) | Ensures that input is reference. Example: reshape , transpose , to_dim |
prefix into_ (some manuplication functions) | Only changes layout, and does not change data with its lifetime and mutability. Example: into_broadcast , into_transpose , into_dyn |
prefix into_ output is always Tensor (some manuplication functions) | Give owned tensor. This special case will occur when there is possiblity to generate a new tensor by manuplication function. For these cases, prefix to_ and change_ will give output TensorCow , prefix into_ will give Tensor . Example: into_shape , into_layout |
prefix change_ output is always TensorCow (some manuplication functions) | Give copy-on-write tensor by consuming input. This special case will occur when there is possiblity to generate a new tensor by manuplication function. Example: change_shape , change_layout |
type annotation Args | Input tuple type as overloadable parameters. Example: zeros , asarray |
type annotation Inp | Additional annotation that rust requires for type deduction. Example: zeros , asarray |
Re-exports§
pub use tensorbase::Tensor;
pub use tensorbase::TensorAny;
pub use tensorbase::TensorArc;
pub use tensorbase::TensorBase;
pub use tensorbase::TensorCow;
pub use tensorbase::TensorMut;
pub use tensorbase::TensorRef;
pub use tensorbase::TensorReference;
pub use tensorbase::TensorView;
pub use tensorbase::TensorViewMut;
Modules§
- api_
specification - API Specification of RSTSR
- array_
api_ standard - Array API standard Fullfillment
- device_
cpu_ serial - Backend for CPU, serial only.
- device_
faer - Backend for CPU, some using rayon for parallel, but matmul should be implemented elsewhere.
- feature_
rayon - This module contains some features for rayon (parallel).
- format
- prelude
- prelude_
dev - storage
- tensor
- tensorbase