{"record":{"id":"2739027f63123c03","repo":"tensorflow/models","slug":"the-type-of-input-shape-argument-is-not-supported-273902","errorCode":null,"errorMessage":"The type of input shape argument is not supported, got: %s","messagePattern":"The type of input shape argument is not supported, got: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/transformer_encoder_block.py","lineNumber":293,"sourceCode":"          self._kernel_initializer\n      )\n    self._attention_axes = attention_axes\n\n    if self._diff_q_kv_att_layer_norm and not self._norm_first:\n      raise ValueError(\n          \"Setting `diff_q_and_kv_attention_layer_norm` to True\"\n          \"when `norm_first` is False is invalid.\"\n      )\n\n  def build(self, input_shape):\n    if isinstance(input_shape, tf.TensorShape):\n      input_tensor_shape = input_shape\n    elif isinstance(input_shape, (list, tuple)):\n      input_tensor_shape = tf.TensorShape(input_shape[0])\n    elif isinstance(input_shape, dict):\n      input_tensor_shape = tf.TensorShape(input_shape[\"input_tensor\"])\n    else:\n      raise ValueError(\n          \"The type of input shape argument is not supported, got: %s\" %\n          type(input_shape))\n    einsum_equation = \"abc,cd->abd\"\n    if len(input_tensor_shape.as_list()) > 3:\n      einsum_equation = \"...bc,cd->...bd\"\n    hidden_size = input_tensor_shape[-1]\n    if hidden_size % self._num_heads != 0:\n      logging.warning(\n          \"The input size (%d) is not a multiple of the number of attention \"\n          \"heads (%d)\", hidden_size, self._num_heads)\n    if self._key_dim is None:\n      self._key_dim = int(hidden_size // self._num_heads)\n    if self._output_last_dim is None:\n      last_output_shape = hidden_size\n    else:\n      last_output_shape = self._output_last_dim\n\n    attention_layer_kwargs = dict(","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/transformer_encoder_block.py#L275-L311","documentation":"Error \"The type of input shape argument is not supported, got: %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/transformer_encoder_block.py:293 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"}