v2.0.0rc0 —
Release Candidate
Released: April 2026
This is the first release candidate of the v2 architecture. It is feature-complete
and considered stable for production use; the rc0 tag will be dropped once the CI
suite is fully green across all three backends (TensorFlow, JAX, PyTorch).
Upgrading from v1.0.0
No user-facing API changes relative to v1.0.0. The release candidate hardens the internal test infrastructure and continuous-integration pipeline. All constructor signatures, parameter names, and return shapes are identical to v1.0.0.
Bug Fixes
Resolved
TypeError: metaclass conflictthat prevented importing the four KerasLosssub-classes (MeanSquaredErrorLoss,QuantileLoss,HuberLoss,WeightedLoss) when theNNLearnermixin — whose metaclass is incompatible with TensorFlow’s trackable metaclass — was present in the inheritance chain. Fixed by removingNNLearnerfrom all four loss classes.Resolved
ModuleNotFoundError: No module named 'torch'that caused pytest collection to abort entirely on environments where PyTorch is not installed. The bareimport torchat module level intest_cov_implementations_gaps.pywas replaced withpytest.importorskip("torch", ...)so the file is gracefully skipped rather than failing.Resolved
TypeError: function() argument 'code' must be code, not strduring test collection on TensorFlow-only environments. Root cause: the Keras-patch helper intest_cov_components_pure.pyandtest_cov_components_keras.pyusedlambda *a, **kw: Noneas the default fallback for unknownKERAS_DEPSattributes (includingLoss,Layer,Model). Subclassing a lambda triggers Python’sfunctiontype as the metaclass, which then receives the class name as a string in place of a code object. Fixed by:Removing
os.environ.setdefault("KERAS_BACKEND", "torch")— the tests now run against whatever backend is available (TensorFlow on CI).Introducing
_KerasStub— a genuine Python class — as the default fallback so any unknown Keras base class resolves to a safe, importable stub.Explicitly mapping
"Loss","Layer", and"Model"in_FALLBACKSto_KerasStub, and"register_keras_serializable"to a no-op decorator factory.
Internal
Test collection: all 178 tests across
test_cov_components_pureandtest_cov_components_kerasnow collect without errors on TensorFlow-only environments.CI matrix continues to target Python 3.10, 3.11, and 3.12 with the TensorFlow backend; JAX and PyTorch jobs are skipped cleanly when the respective backend is absent.