Clean up duplicated inputs_quantizer (#19604)

* Cleanup duplicated `inputs_quantizer` and add type check for `input_spec` and `supports_masking`

* Revert setter
This commit is contained in:
james77777778 2024-04-24 11:53:10 +08:00 committed by GitHub
parent d84d5ccd06
commit 4e0a920ea1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 6 deletions

@ -557,8 +557,6 @@ class Dense(Layer):
self._tracker.unlock()
if mode == "int8":
# Configure `self.inputs_quantizer`
self.inputs_quantizer = quantizers.AbsMaxQuantizer(axis=-1)
# Quantize `self._kernel` to int8 and compute corresponding scale
kernel_value, kernel_scale = quantizers.abs_max_quantize(
self._kernel, axis=0

@ -684,10 +684,6 @@ class EinsumDense(Layer):
self._custom_gradient_equation,
self._kernel_reverse_transpose_axes,
) = _analyze_quantization_info(self.equation, self.input_spec.ndim)
# Configure `self.inputs_quantizer`
self.inputs_quantizer = quantizers.AbsMaxQuantizer(
axis=self._input_reduced_axes
)
# Quantize `self._kernel` to int8 and compute corresponding scale
kernel_value, kernel_scale = quantizers.abs_max_quantize(
self._kernel, axis=self._kernel_reduced_axes