class_docstr: QuantizeConfig for RNN layers.
class_docstr_tok: ["QuantizeConfig","for","RNN","layers","."]
code: def set_quantize_weights(self, layer, quantize_weights):
      flattened_weight_attrs = self._flatten(self.weight_attrs)
      if len(flattened_weight_attrs) != len(quantize_weights):
          raise ValueError(
              "`set_quantize_weights` called on layer {} with {} "
              "weight parameters, but layer expects {} values.".format(
                  layer.name,
                  len(quantize_weights),
                  len(flattened_weight_attrs),
              )
          )
  
      i = 0
      for weight_attrs_cell, rnn_cell in zip(
          self.weight_attrs, self._get_rnn_cells(layer)
      ):
          for weight_attr in weight_attrs_cell:
              current_weight = getattr(rnn_cell, weight_attr)
              quantize_weight = quantize_weights[i]
  
              if current_weight.shape != quantize_weight.shape:
                  raise ValueError(
                      "Existing layer weight shape {} is incompatible with"
                      "provided weight shape {}".format(
                          current_weight.shape, quantize_weight.shape
                      )
                  )
  
              setattr(rnn_cell, weight_attr, quantize_weight)
              i += 1
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Dict
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_config
  from tensorflow_model_optimization.python.core.quantization.keras import quantize_registry
  from tensorflow_model_optimization.python.core.quantization.keras import quantizers
  from tensorflow_model_optimization.python.core.quantization.keras.experimental.default_n_bit import default_n_bit_quantize_configs
  from tensorflow_model_optimization.python.core.quantization.keras.experimental.default_n_bit import default_n_bit_quantizers
label_desc: Use image node_id 4 for calling the DefaultNBitQuantizeConfigRNN obj's underlying member method code with example usage: obj.set_quantize_weights(layer, quantize_weights) without return types