Crate rstsr_core

Source
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 and DeviceFaer, so rstsr-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:

§Variable naming convention

§Abbreviations of type annotations

AbbreviationMeaning
TRTensor type (struct TensorBase)
TData type (can be f64, Complex<f32>, etc)
BBackend (device) type (applies DeviceAPI)
DDimensional (applies DimAPI)
SStorage (struct storage::Storage)
RData with lifetime and mutability (applies DataCloneAPI)
CContent (usually Vec<T> for CPU devices)

§Variable or Names

RuleConvention
suffix APITraits.
To avoid naming collision with structs or other crates.
Example: DeviceAPI, AsArrayAPI
suffix _fFallible 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 ArgsInput tuple type as overloadable parameters.
Example: zeros, asarray
type annotation InpAdditional 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

Type Aliases§

DeviceCpu