fix(gaps): G4 — re-enable all rtx-transformers Phase 2/3 modules (222 compile errors fixed)
Uncommented all deferred modules in lib.rs and fixed API drift across ~60 files in 9 module groups: continual, curriculum, meta, modular, neural_ode, graph, kan, perceiver, distributed/pipeline_parallelism. Common patterns fixed across modules: - Tensor::randn/zeros/ones([a,b]) → (&[a,b], device)? (slice + Result) - Result<T, TensorError> → .map_err(Into::into)? in TransformerError contexts - Device by value → &device references - &Tensor where Tensor expected → .clone() - tensor.relu()/tanh()/sigmoid() as methods not ops functions - Tensor arithmetic returning Result: (a + b)? → (a.clone() + b)? - shape literals → shape.dims() for Shape type - sum(n) → sum(Some(n)), mean(None) → mean(&[], false) - i64 indices → usize where required - backward(x) → backward(x, None) - Borrow conflicts on self.field resolved by extracting to locals before mut borrow - BatchingStats private fields → pub(crate) - TransformerError::Serialization → ::SerializationError - Add scalar to tensor: (t + 0.1)? → t.add_scalar(0.1)? Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
448c0a0be5
commit
a08adfbf57
@@ -135,6 +135,14 @@ pub enum TransformerError {
|
||||
#[allow(non_camel_case_types)]
|
||||
shape_mismatch(String),
|
||||
|
||||
/// Shape mismatch errors (PascalCase alias)
|
||||
#[error("Shape mismatch: {0}")]
|
||||
ShapeMismatch(String),
|
||||
|
||||
/// Invalid state errors
|
||||
#[error("Invalid state: {0}")]
|
||||
InvalidState(String),
|
||||
|
||||
/// Dimension errors
|
||||
#[error("Dimension error: {0}")]
|
||||
#[allow(non_camel_case_types)]
|
||||
@@ -164,6 +172,10 @@ pub enum TransformerError {
|
||||
#[error("KAN error: {0}")]
|
||||
KAN(String),
|
||||
|
||||
/// Configuration errors (alias for Config)
|
||||
#[error("Configuration error: {0}")]
|
||||
Configuration(String),
|
||||
|
||||
/// Tensor errors from rtx-tensor
|
||||
#[error("Tensor error: {0}")]
|
||||
TensorError(#[from] rtx_tensor::TensorError),
|
||||
|
||||
Reference in New Issue
Block a user