{"record":{"id":"9532cde747ebe216","repo":"tensorflow/models","slug":"unknown-attn-type","errorCode":null,"errorMessage":"Unknown `attn_type` {}.","messagePattern":"Unknown `attn_type` (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/xlnet/xlnet_modeling.py","lineNumber":665,"sourceCode":"            tf.equal(cat_id, tf.constant([data_utils.SEG_ID_CLS]))[None, :])\n        seg_mat = tf.equal(seg_id[:, None], cat_id[None, :])\n        seg_mat = tf.logical_or(cls_mat, seg_mat)\n      else:\n        seg_mat = tf.logical_not(tf.equal(seg_id[:, None], cat_id[None, :]))\n    else:\n      seg_mat = None\n\n    dtype = self.tf_float\n    freq_seq = tf.range(0, self.d_model, 2.0)\n    if dtype is not None and dtype != tf.float32:\n      freq_seq = tf.cast(freq_seq, dtype=self.dtype)\n\n    if self.attn_type == \"bi\":\n      beg, end = klen, -qlen\n    elif self.attn_type == \"uni\":\n      beg, end = klen, -1\n    else:\n      raise ValueError(\"Unknown `attn_type` {}.\".format(self.attn_type))\n\n    if self.bi_data:\n      fwd_pos_seq = tf.range(beg, end, -1.0)\n      bwd_pos_seq = tf.range(-beg, -end, 1.0)\n\n      if dtype is not None and dtype != tf.float32:\n        fwd_pos_seq = tf.cast(fwd_pos_seq, dtype=dtype)\n        bwd_pos_seq = tf.cast(bwd_pos_seq, dtype=dtype)\n\n      if self.clamp_len > 0:\n        fwd_pos_seq = tf.clip_by_value(fwd_pos_seq, -self.clamp_len,\n                                       self.clamp_len)\n        bwd_pos_seq = tf.clip_by_value(bwd_pos_seq, -self.clamp_len,\n                                       self.clamp_len)\n\n      if bsz is not None:\n        fwd_pos_emb = self.fwd_position_embedding(fwd_pos_seq, bsz // 2)\n        bwd_pos_emb = self.bwd_position_embedding(bwd_pos_seq, bsz // 2)","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/xlnet/xlnet_modeling.py#L647-L683","documentation":"Error \"Unknown `attn_type` {}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/xlnet/xlnet_modeling.py:665 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"}