@@ -585,20 +585,20 @@ def request_kif(layer: Layer) -> tuple[KIF_t, ...]:
585
585
return kif
586
586
587
587
588
- def requested_by_quantizer (layer : Layer ) -> bool :
588
+ def requested_by_non_saturating_quantizer (layer : Layer ) -> bool :
589
589
"""Check if the current requested kif is from a quantizer.
590
590
591
591
Args:
592
592
layer (Layer): The layer to check.
593
593
594
594
Returns:
595
- bool: True if requested by a quantizer, False otherwise.
595
+ bool: True if requested by a non-saturating quantizer, False otherwise.
596
596
"""
597
597
for n in get_output_layers (layer ):
598
- if isinstance (n , FixedPointQuantizer ):
598
+ if isinstance (n , FixedPointQuantizer ) and n . SAT not in ( 'SAT' , 'SAT_SYM' ) :
599
599
return True
600
600
if isinstance (n , Reshape ):
601
- return requested_by_quantizer (n )
601
+ return requested_by_non_saturating_quantizer (n )
602
602
return False
603
603
604
604
@@ -607,7 +607,7 @@ def default_register_precision(layer: Layer):
607
607
_rk , _ri , _rf = requested_kif (layer ) # Maximum possible k,i,f may be utilized by the next layer
608
608
_oi , _of = np .minimum (_pi , _ri ), np .minimum (_pf , _rf )
609
609
610
- if requested_by_quantizer (layer ):
610
+ if requested_by_non_saturating_quantizer (layer ):
611
611
_ok = _rk
612
612
else :
613
613
_ok = np .minimum (_pk , _rk )
0 commit comments