{"record":{"id":"2ef4a17080fd1e4b","repo":"tensorflow/models","slug":"unexpected-inputs-to-s-with-length-at-d-2ef4a1","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/reuse_transformer.py","lineNumber":298,"sourceCode":"      inputs: a single tensor or a list of tensors.\n        `input tensor` as the single sequence of embeddings.\n        [`input tensor`, `attention mask`] to have the additional attention\n          mask.\n        [`query tensor`, `attention mask`, `attention scores`] to have\n        additional attention scores for reuse computation. If `attention scores`\n        is None, the reuse_attention flag will be ignored.\n    Returns:\n      An output tensor with the same dimensions as input/query tensor.\n      Attention scores if return_attention_scores is true.\n    \"\"\"\n    if isinstance(inputs, (list, tuple)):\n      if len(inputs) == 2:\n        input_tensor, attention_mask = inputs\n        reuse_attention_scores = None\n      elif len(inputs) == 3:\n        input_tensor, attention_mask, reuse_attention_scores = inputs\n      else:\n        raise ValueError(\"Unexpected inputs to %s with length at %d\" %\n                         (self.__class__, len(inputs)))\n    else:\n      input_tensor, attention_mask, reuse_attention_scores = (inputs, None,\n                                                              None)\n\n    key_value = None\n\n    if self._reuse_attention != 0 and reuse_attention_scores is None:\n      raise ValueError(\n          \"reuse_attention_scores cannot be None when reuse_attention != 0.\")\n\n    if self._output_range:\n      if self._norm_first:\n        source_tensor = input_tensor[:, 0:self._output_range, :]\n        input_tensor = self._attention_layer_norm(input_tensor)\n        if key_value is not None:\n          key_value = self._attention_layer_norm(key_value)\n      target_tensor = input_tensor[:, 0:self._output_range, :]","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/reuse_transformer.py#L280-L316","documentation":"Error \"Unexpected inputs to %s with length at %d\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/reuse_transformer.py:298 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"}