{"record":{"id":"7f878922e023f6ea","repo":"tensorflow/models","slug":"unrecognized-constructor","errorCode":null,"errorMessage":"Unrecognized constructor: {}","messagePattern":"Unrecognized constructor: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/data_pipeline.py","lineNumber":982,"sourceCode":"    #   negative item choice index.\n\n    assert np.all((right_index - left_index) <= 1)\n\n    output[not_use_shortcut] = (\n        self._sorted_train_pos_items[right_index] -\n        (self._total_negatives[right_index] - neg_item_choice))\n\n    assert np.all(output >= 0)\n\n    return output\n\n\ndef get_constructor(name):\n  if name == \"bisection\":\n    return BisectionDataConstructor\n  if name == \"materialized\":\n    return MaterializedDataConstructor\n  raise ValueError(\"Unrecognized constructor: {}\".format(name))\n","sourceCodeStart":964,"sourceCodeEnd":983,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/data_pipeline.py#L964-L983","documentation":"Raised in get_constructor when the data-constructor name is neither 'bisection' nor 'materialized'; only these two NCF negative-sampling constructors exist.","triggerScenarios":"Thrown at official/recommendation/data_pipeline.py:982 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use constructor type 'bisection' or 'materialized' in your config","Check spelling of the constructor name string","Register/extend get_constructor with a new branch if you added a custom DataConstructor subclass"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}