Skip to main content

Crate luma_tensor

Crate luma_tensor 

Source
Expand description

luma-tensor — a tensor computation library with:

  • Compile-time kind separation (Float, Int, Bool) so a Float tensor cannot accidentally participate in a Bool operation.
  • Runtime precision (f32, f64, i32, …) within each kind, decided at construction time via DType.
  • A device abstraction (Device) that lets the same code run on Cpu or (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 Op and its op-kind enums.
scalar
Scalar values mirroring crate::DType variants.
tensor

Macros§

bail
dispatch_float
Run $body with $data bound to the inner &Vec<t> of a CpuFloatStorage, then wrap the returned Vec<t> back into a CpuFloatStorage.
dispatch_float2
Dispatch two float storages of the SAME variant; errors on mismatch.
dispatch_float2_raw
Dispatch two float storages of the SAME variant, $body yields a raw value.
dispatch_float_raw
Like dispatch_float but $body yields 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 Slice with python-like syntax.