{"record":{"id":"e892d7c77d468d5c","repo":"tensorflow/models","slug":"unexpected-inputs-to-s-with-length-at-d-e892d7","errorCode":null,"errorMessage":"Unexpected inputs to %s with length at %d","messagePattern":"Unexpected inputs to (.+?) with length at (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/transformer_scaffold.py","lineNumber":302,"sourceCode":"        \"kernel_constraint\": tf_utils.serialize_constraint(\n            self._kernel_constraint, use_legacy_format=True\n        ),\n        \"bias_constraint\": tf_utils.serialize_constraint(\n            self._bias_constraint, use_legacy_format=True\n        ),\n    }\n    base_config = super().get_config()\n    return dict(list(base_config.items()) + list(config.items()))\n\n  def call(self, inputs, training=None):\n    if isinstance(inputs, (list, tuple)):\n      if len(inputs) == 2:\n        input_tensor, attention_mask = inputs\n        key_value = None\n      elif len(inputs) == 3:\n        input_tensor, key_value, attention_mask = inputs\n      else:\n        raise ValueError(\"Unexpected inputs to %s with length at %d\" %\n                         (self.__class__, len(inputs)))\n    else:\n      input_tensor, key_value, attention_mask = (inputs, None, None)\n\n    if key_value is None:\n      key_value = input_tensor\n\n    if self._norm_first:\n      source_tensor = input_tensor\n      input_tensor = self._attention_layer_norm(input_tensor, training=training)\n\n    attention_output = self._attention_layer(\n        query=input_tensor, value=key_value, attention_mask=attention_mask,\n        training=training)\n    attention_output = self._attention_dropout(attention_output,\n                                               training=training)\n\n    if self._norm_first:","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/transformer_scaffold.py#L284-L320","documentation":"Error \"Unexpected inputs to %s with length at %d\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/transformer_scaffold.py:302 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"}