{"record":{"id":"c3aaa251047b7740","repo":"keras-team/keras","slug":"ragged-true-is-not-supported-with-jax-backend","errorCode":null,"errorMessage":"`ragged=True` is not supported with jax backend","messagePattern":"`ragged=True` is not supported with jax backend","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/core.py","lineNumber":373,"sourceCode":"            self._var_metadata[name] = value\n\n        object.__setattr__(self, name, value)\n\n    NnxVariable.__setattr__ = __setattr__\n\n\ndef should_shard_at_init(init_layout, shape):\n    size_threshold = 250 * 1024 * 1024\n    # We multiply by the mesh size here to take into account the worst case\n    # scenario of the array being first duplicated in the memory of one device\n    # before being transferred to the other devices.\n    size = math.prod(shape) * 4 * init_layout.mesh.devices.size\n    return size >= size_threshold\n\n\ndef convert_to_tensor(x, dtype=None, sparse=None, ragged=None):\n    if ragged:\n        raise ValueError(\"`ragged=True` is not supported with jax backend\")\n    if dtype is not None:\n        dtype = standardize_dtype(dtype)\n    if isinstance(x, (jnp.ndarray, jax.Array)) and (\n        dtype is None or x.dtype == dtype\n    ):\n        # Skip the conversion early if the instance is already a JAX array.\n        # This is important in the multi-process context since jax.array(x) for\n        # an existing distributed jax array will raise error.\n        return x\n\n    if isinstance(x, Variable):\n        if dtype is not None and x.dtype != dtype:\n            return x.value.astype(dtype)\n        return x.value\n\n    if isinstance(x, jax_sparse.JAXSparse):\n        if sparse is not None and not sparse:\n            x = x.todense()","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/core.py#L355-L391","documentation":"Error \"`ragged=True` is not supported with jax backend\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/core.py:373 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}