{"record":{"id":"e63e7e58b5848ee4","repo":"tensorflow/models","slug":"only-support-binary-relation-in-restriction","errorCode":null,"errorMessage":"Only support binary relation in restriction.","messagePattern":"Only support binary relation in restriction\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/modeling/hyperparams/params_dict.py","lineNumber":282,"sourceCode":"    def _get_kv(dotted_string, params_dict):\n      \"\"\"Get keys and values indicated by dotted_string.\"\"\"\n      if _CONST_VALUE_RE.match(dotted_string) is not None:\n        const_str = dotted_string\n        if const_str == 'None':\n          constant = None\n        else:\n          constant = float(const_str)\n        return None, constant\n      else:\n        tokenized_params = dotted_string.split('.')\n        v = params_dict\n        for t in tokenized_params:\n          v = v[t]\n        return tokenized_params[-1], v\n\n    def _get_kvs(tokens, params_dict):\n      if len(tokens) != 2:\n        raise ValueError('Only support binary relation in restriction.')\n      stripped_tokens = [t.strip() for t in tokens]\n      left_k, left_v = _get_kv(stripped_tokens[0], params_dict)\n      right_k, right_v = _get_kv(stripped_tokens[1], params_dict)\n      return left_k, left_v, right_k, right_v\n\n    params_dict = self.as_dict()\n    for restriction in self._restrictions:\n      if '==' in restriction:\n        tokens = restriction.split('==')\n        _, left_v, _, right_v = _get_kvs(tokens, params_dict)\n        if left_v != right_v:\n          raise KeyError(\n              'Found inconsistency between key `{}` and key `{}`.'.format(\n                  tokens[0], tokens[1]))\n      elif '!=' in restriction:\n        tokens = restriction.split('!=')\n        _, left_v, _, right_v = _get_kvs(tokens, params_dict)\n        if left_v == right_v:","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/hyperparams/params_dict.py#L264-L300","documentation":"Error \"Only support binary relation in restriction.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/hyperparams/params_dict.py:282 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"}