Ensures backend-agnostic tensor operations using Keras 3 ops for seamless integration across PyTorch, JAX, and TensorFlow.
This skill automates the implementation of Keras 3's backend-agnostic tensor math within the BayesFlow ecosystem. It enforces the 'Golden Rule' of using keras.ops.* instead of framework-specific calls like torch.sum or np.exp, ensuring that custom layers, loss functions, and network forward passes remain fully portable across PyTorch, JAX, and TensorFlow backends. By providing optimized patterns for gradient management, memory-efficient sampling, and straight-through estimators, it helps developers build robust, cross-compatible deep learning components without manual backend debugging.
Características Principales
01Proactive detection of common backend-specific coding mistakes
02Standardized patterns for gradient management and stop_gradient implementation
03Automated enforcement of keras.ops.* for backend-agnostic math
04Safe boundary handling between NumPy arrays and Keras tensors