Expand description
luma-tensor — a tensor computation library with:
- Compile-time kind separation (
Float,Int,Bool) so aFloattensor cannot accidentally participate in aBooloperation. - Runtime precision (
f32,f64,i32, …) within each kind, decided at construction time viaDType. - A device abstraction (
Device) that lets the same code run onCpuor (in the future)Cuda. - A tape-based autograd engine that tracks only
Float-kind tensors.
Re-exports§
pub use device::cpu::Cpu;pub use device::cpu::CpuBoolStorage;pub use device::cpu::CpuFloatStorage;pub use device::cpu::CpuIntStorage;pub use device::BoolOps;pub use device::Device;pub use device::FloatOps;pub use device::IntOps;pub use dtype::Bool;pub use dtype::DType;pub use dtype::DTypeKind;pub use dtype::Float;pub use dtype::Int;pub use dtype::KindTag;pub use dtype::Storage;pub use dtype::FloatDType;pub use dtype::IntDType;pub use dtype::BoolDType;pub use dynamic::DynTensor;pub use error::Error;pub use error::Result;pub use grad::FloatMeta;pub use grad::GradStore;pub use grad::NoGradGuard;pub use grad::TensorMeta;pub use grad::is_grad_enabled;pub use grad::set_grad_enabled;pub use ops::BinaryOp;pub use ops::CmpOp;pub use ops::FloatUnaryOp;pub use ops::Op;pub use ops::ReduceOp;pub use ops::TransferDTypeKind;pub use ops::UnaryOp;pub use ops::ViewOp;pub use ops::IndexOp;pub use ops::Indexer;pub use ops::Slice;pub use scalar::Scalar;pub use tensor::D;pub use tensor::Dim;pub use tensor::Dims;pub use tensor::Layout;pub use tensor::Shape;pub use tensor::StorageIndices;pub use tensor::Tensor;pub use tensor::TensorId;pub use tensor::TensorImpl;
Modules§
- device
- dtype
- dynamic
- Type-erased tensor enum for runtime kind dispatch.
- error
- grad
- ops
- The autograd computation-graph node type
Opand its op-kind enums. - scalar
- Scalar values mirroring
crate::DTypevariants. - tensor
Macros§
- bail
- dispatch_
float - Run
$bodywith$databound to the inner&Vec<t>of aCpuFloatStorage, then wrap the returnedVec<t>back into aCpuFloatStorage. - dispatch_
float2 - Dispatch two float storages of the SAME variant; errors on mismatch.
- dispatch_
float2_ raw - Dispatch two float storages of the SAME variant,
$bodyyields a raw value. - dispatch_
float_ raw - Like
dispatch_floatbut$bodyyields a non-storage value (e.g. Vec). - dispatch_
int - dispatch_
int2 - dispatch_
int2_ raw - dispatch_
int_ raw - no_grad
- Temporarily disable gradient tracking within the current scope.
- s
- Create a
Slicewith python-like syntax.