chore: import upstream snapshot with attribution
Docker Image CI / build-ubuntu2004 (push) Has been cancelled
Docker Image CI / build-ubuntu2004 (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
.. _cqdq_api:
|
||||
|
||||
**tensorflow_quantization.CustomQDQInsertionCase**
|
||||
==================================================
|
||||
|
||||
.. autoclass:: tensorflow_quantization.CustomQDQInsertionCase
|
||||
:members:
|
||||
|
||||
Example
|
||||
|
||||
.. code:: python
|
||||
|
||||
class EfficientNetQDQCase(CustomQDQInsertionCase):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def info(self):
|
||||
return "In Multiply operation quantize inputs at index 0 and 1."
|
||||
|
||||
def case(self, keras_model: 'tf.keras.Model', qspec: 'QuantizationSpec') -> 'QuantizationSpec':
|
||||
se_block_qspec_object = QuantizationSpec()
|
||||
for layer in keras_model.layers:
|
||||
if isinstance(layer, tf.keras.layers.Multiply):
|
||||
se_block_qspec_object.add(layer.name, quantize_input=True, quantize_weight=False, quantization_index=[0, 1])
|
||||
return se_block_qspec_object
|
||||
|
||||
Reference in New Issue
Block a user