{"record":{"id":"55a6a65c64ffc5a5","repo":"tensorflow/models","slug":"embedding-dim-is-not-either-a-list-or-an-int-got","errorCode":null,"errorMessage":"embedding_dim is not either a list or an int, got {type(embedding_dim)}","messagePattern":"embedding_dim is not either a list or an int, got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/ranking/task.py","lineNumber":79,"sourceCode":"    max_unique_ids_per_table: Maximum number of unique embedding ids per table.\n    allow_id_dropping: bool to allow id dropping.\n    initialize_tables_on_host: bool : if the embedding table size is more than \n      what HBM can handle, this flag will help initialize the full embedding\n      tables on host and then copy shards to HBM.\n\n  Returns:\n    A dictionary of feature_name, FeatureConfig pairs.\n  \"\"\"\n  if isinstance(embedding_dim, List):\n    if len(vocab_sizes) != len(embedding_dim):\n      raise ValueError(\n          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '\n          f'length of embedding_dim: {len(embedding_dim)}'\n      )\n  elif isinstance(embedding_dim, int):\n    embedding_dim = [embedding_dim] * len(vocab_sizes)\n  else:\n    raise ValueError(\n        'embedding_dim is not either a list or an int, got '\n        f'{type(embedding_dim)}'\n    )\n\n  if isinstance(max_ids_per_table, List):\n    if len(vocab_sizes) != len(max_ids_per_table):\n      raise ValueError(\n          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '\n          f'length of max_ids_per_table: {len(max_ids_per_table)}'\n      )\n  elif isinstance(max_ids_per_table, int):\n    max_ids_per_table = [max_ids_per_table] * len(vocab_sizes)\n  elif max_ids_per_table is not None:\n    raise ValueError(\n        'max_ids_per_table is not either a list or an int or None, got '\n        f'{type(max_ids_per_table)}'\n    )\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/ranking/task.py#L61-L97","documentation":"Error \"embedding_dim is not either a list or an int, got {type(embedding_dim)}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/ranking/task.py:79 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"}