v2.0.0 —
Stable Release
Released: April 2026
Upgrading from v2.0.0rc1
No user-facing API changes. This stable release closes out the v2 release candidate cycle. All CI matrices (Linux, macOS, Windows × Python 3.10/3.11/3.12) are green at 94 % test coverage.
Bug Fixes
Fixed
TypeError: can't convert mps:0 device type tensor to numpyinCRPSLoss._crps_mixture_mcon Apple Silicon (MPS). The entire mixture MC computation now moves inputs to CPU at entry when an MPS device is detected, becausekeras.ops.mean/sum/absinternally call NumPy in the CI-runner version of Keras, which fails for MPS tensors.Fixed
ValueError: operands could not be broadcast together with shapes (2,3,2,1) (2,3,1)inCRPSLoss._crps_mixture_mcon Linux CI. Weight normalisation now usestf_expand_dims(tf_reduce_sum(w, axis=2), axis=2)instead oftf_reduce_sum(w, axis=2, keepdims=True)for non-torch backends, making the shape reconstruction explicit and independent ofkeepdimsbehaviour in the installed Keras version.Fixed
TypeErrorinSqueezeExcite1D.callanddrop_pathwhen the output ofkeras.opslanded on a different device than the input tensor (MPS vs. CPU mismatch); added.to(x.device)guards matching the pattern already used inlayer_utils.py.Fixed
TypeErrorfromnp.asarray(mps_tensor)calls intest_cov_components_keras.py; replaced with the_to_numpyhelper (which first calls.cpu()on torch tensors) in all five affected assertion sites.Fixed monkey-patch lambda
np.asarray(x).shapein thetest_query_mask_builds_attention_masktest — replaced with_to_numpy(x).shapeto survive MPS tensors.Fixed
_get_static_valueinbase_attentive/__init__.py: TensorFlow’sget_static_valuereturns the input object unchanged for non-tensor Python objects; added aresult is not valueguard so the function correctly returnsNonein that case.Fixed
_tf_build_positional_encodingincomponents/misc.pyto build the angle matrix entirely in NumPy and only materialise a backend tensor at the end viatf_cast, avoiding MPS in-place slice-assignment failures (mps_tensor[:, 0::2] = …).Fixed
broadcast_likeinlayer_utils.py: added a_scalar_to_inthelper that calls.cpu().item()on each rep scalar beforetf_tile, preventingkeras.src.backend.torch.numpy.tilefrom callingrepeats.int().numpy()on an MPS tensor.
Infrastructure / CI
Test suite now passes the full Linux × macOS × Windows CI matrix at 94 % coverage (up from ~88 % at rc0).
test_cov_losses_extended.py—test_mixture_mode_dictmock refactored across three rounds to minimise monkey-patching: onlytf_gatheris mocked (batch_dims=1cross-backend compat); real Keras ops are used for all other computations.
Documentation
Version badge in
docs/index.rstupdated to2.0.0.Citation in
README.mdupdated toversion = {2.0.0}.pyproject.tomlclassifier promoted fromDevelopment Status :: 4 - BetatoDevelopment Status :: 5 - Production/Stable.