{"record":{"id":"e61e4cc6cb354a05","repo":"tensorflow/models","slug":"unsupported-truncator-s","errorCode":null,"errorMessage":"Unsupported truncator: %s","messagePattern":"Unsupported truncator: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/text_layers.py","lineNumber":582,"sourceCode":"      raise ValueError(\"At least one input is required for packing\")\n    input_ranks = [rt.shape.rank for rt in inputs]\n    if None in input_ranks or len(set(input_ranks)) > 1:\n      raise ValueError(\"All inputs for packing must have the same known rank, \"\n                       \"found ranks \" + \",\".join(input_ranks))\n    # Flatten inputs to [batch_size, (tokens)].\n    if input_ranks[0] > 2:\n      inputs = [rt.merge_dims(1, -1) for rt in inputs]\n    # In case inputs weren't truncated (as they should have been),\n    # fall back to some ad-hoc truncation.\n    num_special_tokens = len(inputs) + 1\n    if truncator == \"round_robin\":\n      trimmed_segments = text.RoundRobinTrimmer(seq_length -  # pyrefly: ignore[missing-attribute]\n                                                num_special_tokens).trim(inputs)\n    elif truncator == \"waterfall\":\n      trimmed_segments = text.WaterfallTrimmer(  # pyrefly: ignore[missing-attribute]\n          seq_length - num_special_tokens).trim(inputs)\n    else:\n      raise ValueError(\"Unsupported truncator: %s\" % truncator)\n    # Combine segments.\n    segments_combined, segment_ids = text.combine_segments(  # pyrefly: ignore[missing-attribute]\n        trimmed_segments,\n        start_of_sequence_id=start_of_sequence_id,\n        end_of_segment_id=end_of_segment_id)\n    # Pad to dense Tensors.\n    input_word_ids, _ = text.pad_model_inputs(segments_combined, seq_length,  # pyrefly: ignore[missing-attribute]\n                                              pad_value=padding_id)\n    input_type_ids, input_mask = text.pad_model_inputs(segment_ids, seq_length,  # pyrefly: ignore[missing-attribute]\n                                                       pad_value=0)\n    # Work around broken shape inference.\n    output_shape = tf.stack([\n        inputs[0].nrows(out_type=tf.int32),  # batch_size\n        tf.cast(seq_length, dtype=tf.int32)])\n    def _reshape(t):\n      return tf.reshape(t, output_shape)\n    # Assemble nest of input tensors as expected by BERT TransformerEncoder.\n    return dict(input_word_ids=_reshape(input_word_ids),","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/text_layers.py#L564-L600","documentation":"Error \"Unsupported truncator: %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/text_layers.py:582 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"}