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:
Omar Sobh
2026-06-26 16:08:02 +00:00
co-authored by Claude Sonnet 4.6
parent 448c0a0be5
commit a08adfbf57
106 changed files with 2165 additions and 1897 deletions
@@ -75,7 +75,7 @@ impl GraphBatch {
}
/// Graph attention mechanism types
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum GraphAttentionType {
/// Standard graph attention (GAT)
Standard,
@@ -98,6 +98,19 @@ pub enum AttentionMechanism {
ScaledDotProduct,
}
/// Graph pooling strategies
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum PoolingStrategy {
/// Global mean/max/sum pooling
Global,
/// Hierarchical graph pooling
Hierarchical,
/// Set2Set pooling mechanism
Set2Set,
/// Attention-based pooling
Attention,
}
/// Graph transformer layer trait
pub trait GraphLayer: Send + Sync {
/// Forward pass through the graph layer