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:
parent
d84d5ccd06
commit
4e0a920ea1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user