{"record":{"id":"5fb2d41ce643bd2b","repo":"tensorflow/models","slug":"unexpected-inputs-type-to-s-5fb2d4","errorCode":null,"errorMessage":"Unexpected inputs type to %s.","messagePattern":"Unexpected inputs type to (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/mae/modeling/vit.py","lineNumber":116,"sourceCode":"    self.token_cls = vit.TokenLayer()\n    super().build(input_shape)\n\n  def to_embed(self, patches):\n    return self.patch_to_embed(patches)\n\n  def insert_cls(self, patch_embeds):\n    return self.token_cls(patch_embeds)\n\n  def add_position_embed(self, patch_embeds):\n    return patch_embeds + utils.position_embedding_sine(\n        tf.ones_like(patch_embeds[..., 0]), 1024, normalize=False)\n\n  def call(self, inputs):  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks\n    if isinstance(inputs, dict):\n      images = inputs.get('images', None)\n      patch_embeds = inputs.get('embeddings', None)\n    else:\n      raise ValueError('Unexpected inputs type to %s.' % self.__class__)\n    if images is not None:\n      patches = to_patch(images, self.patch_h, self.patch_w)\n      patch_embeds = self.to_embed(patches)\n      patch_shape = tf.shape(patch_embeds)\n      patch_embeds = self.add_position_embed(patch_embeds)\n      patch_embeds = tf.reshape(patch_embeds,\n                                (patch_shape[0], -1, patch_shape[-1]))\n      patch_embeds = self.insert_cls(patch_embeds)\n    return self.encoder(patch_embeds)\n","sourceCodeStart":98,"sourceCodeEnd":126,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/mae/modeling/vit.py#L98-L126","documentation":"Error \"Unexpected inputs type to %s.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/mae/modeling/vit.py:116 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"}