v2.0.1 —
Bug Fix Release
Released: April 2026
Upgrading from v2.0.0
Drop-in replacement. No API changes. Only the MPS device-conflict bug described below is addressed.
Bug Fixes
Definitive MPS fix for
CRPSLoss._crps_mixture_mcon Apple Silicon (Torch + MPS backend).Previous releases (including v2.0.0) attempted to work around
keras.opsfailing on MPS tensors by moving inputs to CPU at the start of the function. This was not sufficient:keras.ops.*calls such ascumsum,sigmoid,cast,reshape, andgathercan silently re-dispatch CPU tensors back to the default Keras device (MPS on Apple Silicon), causingmu_s/sig_sto land on MPS whileeps(explicitly moved to CPU) remained on CPU — producing:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, mps:0 and cpu!
The fix introduces a pure native-PyTorch early-return path for the MPS case. When
_on_mpsisTrue, the entire sampling / gather / CRPS computation runs withtorch.cumsum,torch.randn,torch.gather, etc. — bypassing allkeras.opsentirely and keeping every tensor on CPU throughout. The non-MPS path (TensorFlow, JAX, CPU-Torch) is unchanged.
Documentation
Expanded Architecture Guide (
docs/architecture_guide.rst). The v2.0.0 Registry / Resolver / Assembly system is now documented in depth:What changed from v1.0.0 and why
Breaking changes with migration examples
ComponentRegistryandModelRegistry— how to register and resolve custom componentsBaseAttentiveSpec/BaseAttentiveComponentSpecfield referenceEnd-to-end build-from-spec example
Updated data-flow diagram reflecting the v2 assembly pipeline
README badges synchronised with
docs/index.rst: added version, semver, Keras ≥ 3.0, backends, last-commit, open-issues, PRs-welcome, and platform badges.
Examples
Two new Jupyter notebooks added to
examples/and rendered as HTML pages within the documentation (see Example Notebooks):06_crps_probabilistic_forecasting.ipynb— covers all threeCRPSLossmodes ("quantile","gaussian","mixture"), Monte Carlo sample-count guidance, output-shape interpretation per mode, and a sketch of a customGradientTape-style training loop.07_v2_spec_registry.ipynb— end-to-end walkthrough of the v2 declarative configuration system:BaseAttentiveSpeccreation, JSON round-trip serialisation,BaseAttentiveComponentSpec, registering a custom encoder viaComponentRegistry,ModelRegistry, andBaseAttentiveV2Assembly.
Notebook rendering via nbsphinx integrated into the Sphinx build pipeline:
nbsphinxadded toextensionsindocs/conf.pywithnbsphinx_execute = "never"so ReadTheDocs renders notebooks without requiring an ML runtime.docs/conf.pyauto-copiesexamples/*.ipynb→docs/notebooks/at build time, keepingexamples/as the single source of truth.New Examples section added to the documentation sidebar (
docs/notebooks/index.rst) with a summary table of all seven notebooks and a Binder badge for interactive execution.nbsphinx>=0.9.0andipython>=8.0.0added to the[docs]optional dependency group inpyproject.toml.