{"record":{"id":"5f2abf1a14d8a5cb","repo":"keras-team/keras","slug":"path-key-matches-multiple-layout-specification","errorCode":null,"errorMessage":"Path '{key}' matches multiple layout specification keys: {matching_keys}. Please make sure each tensor/variable path only matches at most one layout specification key in the LayoutMap.","messagePattern":"Path '(.+?)' matches multiple layout specification keys: (.+?)\\. Please make sure each tensor/variable path only matches at most one layout specification key in the LayoutMap\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/distribution/distribution_lib.py","lineNumber":746,"sourceCode":"        there are multiple matches for the regex, an `ValueError` will be\n        raised. Returns `None` if there isn't any match found.\n\n        Args:\n            key: String key to query a layout.\n\n        Returns:\n            Corresponding layout based on the query.\n        \"\"\"\n        if key in self._layout_map:\n            return self._layout_map[key]\n\n        matching_keys = [\n            pattern\n            for pattern in self._layout_map\n            if re.fullmatch(pattern, key)\n        ]\n        if len(matching_keys) > 1:\n            raise ValueError(\n                f\"Path '{key}' matches multiple layout \"\n                f\"specification keys: {matching_keys}. Please make \"\n                \"sure each tensor/variable path only matches at most \"\n                \"one layout specification key in the LayoutMap.\"\n            )\n        elif len(matching_keys) == 1:\n            return self._layout_map[matching_keys[0]]\n        return None\n\n    def __setitem__(self, key, layout):\n        \"\"\"Insert TensorLayout to the LayoutMap.\n\n        Args:\n            key: String key for the `TensorLayout`.\n            layout: The `TensorLayout`. As a shortcut, tuple of string and None\n                are also acceptable, and will be converted to `TensorLayout`.\n        \"\"\"\n        if key in self._layout_map:","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/distribution/distribution_lib.py#L728-L764","documentation":"Error \"Path '{key}' matches multiple layout specification keys: {matching_keys}. Please make sure each tensor/variable path only matches at most one layout specification key in the LayoutMap.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/distribution/distribution_lib.py:746 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"}