{"record":{"id":"5284c6e600f41abb","repo":"tensorflow/models","slug":"the-type-of-input-shape-argument-is-not-supported-5284c6","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_scaffold.py","lineNumber":133,"sourceCode":"    self._num_heads = num_attention_heads\n    self._inner_dim = inner_dim\n    self._inner_activation = inner_activation\n    self._attention_dropout_rate = attention_dropout_rate\n    self._dropout_rate = dropout_rate\n    self._kernel_initializer = tf_keras.initializers.get(kernel_initializer)\n    self._bias_initializer = tf_keras.initializers.get(bias_initializer)\n    self._kernel_regularizer = tf_keras.regularizers.get(kernel_regularizer)\n    self._bias_regularizer = tf_keras.regularizers.get(bias_regularizer)\n    self._kernel_constraint = tf_keras.constraints.get(kernel_constraint)\n    self._bias_constraint = tf_keras.constraints.get(bias_constraint)\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    else:\n      raise ValueError(\n          \"The type of input shape argument is not supported, got: %s\" %\n          type(input_shape))\n\n    if len(input_tensor_shape.as_list()) != 3:\n      raise ValueError(\n          \"TransformerScaffold expects a three-dimensional input of \"\n          \"shape [batch, sequence, width].\")\n    hidden_size = input_tensor_shape[-1]\n    if hidden_size % self._num_heads != 0:\n      raise ValueError(\n          \"The input size (%d) is not a multiple of the number of attention \"\n          \"heads (%d)\" % (hidden_size, self._num_heads))\n    self._attention_head_size = int(hidden_size // self._num_heads)\n\n    common_kwargs = dict(\n        kernel_regularizer=self._kernel_regularizer,\n        bias_regularizer=self._bias_regularizer,\n        activity_regularizer=self._activity_regularizer,","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/transformer_scaffold.py#L115-L151","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_scaffold.py:133 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"}