Skip to main content

Module traits

Module traits 

Source
Expand description

Common traits for the rust-ai ecosystem.

This module defines shared trait interfaces that enable consistent APIs across all rust-ai crates. Implementing these traits ensures interoperability and allows crates to be composed together seamlessly.

§Core Traits

§Implementation Guidelines

When implementing these traits:

  1. Validation: Use ValidatableConfig::validate() in constructors
  2. GPU-first: GpuDispatchable should prefer GPU, warn on CPU
  3. Error handling: Return CoreError variants appropriately

Traits§

Dequantize
Tensor dequantization trait.
GpuDispatchable
GPU/CPU dispatch trait for operations with both implementations.
Quantize
Tensor quantization trait.
ValidatableConfig
Configuration validation trait.