parameters: (self, training, activation_output)
return_statement: return tf_utils.smart_cond(training, make_quantizer_fn(True),
                                 make_quantizer_fn(False))
docstring: All Keras call() logic for applying weight quantization.
docstring_summary: All Keras call() logic for applying weight quantization.
docstring_tokens: All Keras call () logic for applying weight quantization .
function: def _apply_activation_quantizer(self, training, activation_output):
      """All Keras call() logic for applying weight quantization."""
  
      def make_quantizer_fn(training):
        """Return quantizer conditioned on whether training or not."""
  
        def quantizer_fn():
          weights = {
              'min_var': self._activation_min_var,  # pylint: disable=protected-access
              'max_var': self._activation_max_var}  # pylint: disable=protected-access
          return self.activation_quantizer(
              activation_output,
              training,
              weights=weights)
  
        return quantizer_fn
  
      return tf_utils.smart_cond(training, make_quantizer_fn(True),
                                 make_quantizer_fn(False))
function_tokens: def _apply_activation_quantizer ( self , training , activation_output ) : def make_quantizer_fn ( training ) : """Return quantizer conditioned on whether training or not.""" def quantizer_fn ( ) : weights = { 'min_var' : self . _activation_min_var , # pylint: disable=protected-access 'max_var' : self . _activation_max_var } # pylint: disable=protected-access return self . activation_quantizer ( activation_output , training , weights = weights ) return quantizer_fn return tf_utils . smart_cond ( training , make_quantizer_fn ( True ) , make_quantizer_fn ( False ) )