{"record":{"id":"0b5c7b41afdc8e8a","repo":"tensorflow/models","slug":"variable-name-is-not-supported-on-customlayerqu","errorCode":null,"errorMessage":"Variable name {} is not supported on CustomLayerQuantize({}) transform.","messagePattern":"Variable name (.+?) is not supported on CustomLayerQuantize\\((.+?)\\) transform\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/qat/nlp/quantization/schemes.py","lineNumber":82,"sourceCode":"      'embeddings'\n  })\n\n  def __init__(self):\n    super().__init__()\n    self._original_layer_pattern = 'modeling>TransformerEncoderBlock'\n    self._quantized_layer_class = transformer_encoder_block.TransformerEncoderBlockQuantized\n\n  def pattern(self) -> LayerPattern:\n    \"\"\"See base class.\"\"\"\n    return LayerPattern(self._original_layer_pattern)\n\n  def _is_quantization_weight_name(self, name):\n    simple_name = name.split('/')[-1].split(':')[0]\n    if simple_name in self._QUANTIZATION_AWARE_TRAINING_WEIGHT_NAMES:\n      return True\n    if simple_name in self._SUPPOTRED_MODEL_WEIGHT_NAMES:\n      return False\n    raise ValueError('Variable name {} is not supported on '\n                     'CustomLayerQuantize({}) transform.'.format(\n                         simple_name,\n                         self._original_layer_pattern))\n\n  def replacement(self, match_layer: LayerNode) -> LayerNode:\n    \"\"\"See base class.\"\"\"\n    bottleneck_layer = match_layer.layer\n    bottleneck_config = bottleneck_layer['config']\n    bottleneck_names_and_weights = list(match_layer.names_and_weights)\n    quantized_layer = self._quantized_layer_class(\n        **bottleneck_config)\n\n    quantized_layer_config = quantized_layer.get_config()\n    if 'hidden_size' in quantized_layer_config:\n      dummy_input_shape = [\n          1, 1, quantized_layer_config['hidden_size']]\n      quantized_layer.compute_output_shape(dummy_input_shape)\n    elif 'num_attention_heads' in quantized_layer_config:","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/qat/nlp/quantization/schemes.py#L64-L100","documentation":"Error \"Variable name {} is not supported on CustomLayerQuantize({}) transform.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/qat/nlp/quantization/schemes.py:82 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"}