{"record":{"id":"56d03a057aa920bf","repo":"tensorflow/models","slug":"cache-is-not-supported-for-feature-transform-s","errorCode":null,"errorMessage":"Cache is not supported for feature_transform %s","messagePattern":"Cache is not supported for feature_transform (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/kernel_attention.py","lineNumber":779,"sourceCode":"      training: Python boolean indicating whether the layer should behave in\n        training mode (adding dropout) or in inference mode (doing nothing).\n\n    Returns:\n      Multi-headed outputs of attention computation.\n    \"\"\"\n    if cache is not None:\n      if training:\n        raise ValueError(\n            \"Cache is not supported when training is True.\")\n      if not self.use_causal_windowed:\n        raise ValueError(\n            \"Cache is not supported for non use_causal_windowed case.\")\n      if self._begin_kernel:\n        raise ValueError(\n            \"Cache is not supported when begin_kernel is set since the bahvior \"\n            \"is too complicated.\")\n      if self._feature_transform in _NON_CAUSAL_SUPPORT_TRANSFORM_MAP:\n        raise ValueError(\"Cache is not supported for feature_transform %s\" %\n                         (self._feature_transform))\n\n    if not self._built_from_signature:\n      self._build_from_signature(query=query, value=value, key=key)\n    if key is None:\n      key = value\n\n    #   N = `num_attention_heads`\n    #   H = `size_per_head`\n    # `query` = [B, T, N ,H]\n    query = self._query_dense(query)\n\n    # `key` = [B, S, N, H]\n    key = self._key_dense(key)\n\n    # `value` = [B, S, N, D]\n    value = self._value_dense(value)\n","sourceCodeStart":761,"sourceCodeEnd":797,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/kernel_attention.py#L761-L797","documentation":"Error \"Cache is not supported for feature_transform %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/kernel_attention.py:779 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":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}