Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 569259447
Change-Id: Ic83bcaf2991e859dbc49f46f92506b5a56d7f49e
  • Loading branch information
lishanok authored and copybara-github committed Sep 28, 2023
1 parent 51f3265 commit 3d60be2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion qkeras/qconvolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from tensorflow.keras.layers import InputSpec
from tensorflow.python.eager import context
from tensorflow.python.ops import array_ops
# Google internal code, commented out by copybara
# from tensorflow.python.ops import array_ops
from .qlayers import get_auto_range_constraint_initializer
from .qlayers import QActivation
from .quantizers import get_quantized_initializer
Expand Down
2 changes: 1 addition & 1 deletion qkeras/qrecurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from tensorflow.keras.layers import Bidirectional
from tensorflow.python.util import nest
from tensorflow.python.ops import array_ops
# Google internal code, commented out by copybara
# from tensorflow.python.ops import array_ops
from tensorflow.python.framework import ops
from tensorflow_model_optimization.python.core.sparsity.keras.prunable_layer import PrunableLayer

Expand Down
20 changes: 10 additions & 10 deletions qkeras/qtools/quantized_operators/quantizer_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import copy
from qkeras import quantizers
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# from qkeras.google_internals import experimental_quantizers
# from qkeras.google_internals import experimental_quantizer_impl
from qkeras.qtools.quantized_operators import quantizer_impl
from qkeras.qtools.settings import cfg

Expand Down Expand Up @@ -53,10 +53,10 @@ def __init__(self):
quantizer_impl.QuantizedTanh,
quantizers.quantized_ulaw:
quantizer_impl.QuantizedUlaw,
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# experimental_quantizers.quantized_bits_learnable_scale:
# experimental_quantizer_impl.QuantizedBitsLearnableScale,
# experimental_quantizers.parametric_quantizer_d_xmax:
# experimental_quantizer_impl.ParametricQuantizer,

# add following quantizer types for the use in GraphUpdateEdge
quantizer_impl.QuantizedBits:
Expand All @@ -83,10 +83,10 @@ def __init__(self):
quantizer_impl.StochasticTernary,
quantizer_impl.QuantizedUlaw:
quantizer_impl.StochasticTernary,
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# experimental_quantizer_impl.QuantizedBitsLearnableScale:
# experimental_quantizer_impl.QuantizedBitsLearnableScale,
#experimental_quantizer_impl.ParametricQuantizer:
# experimental_quantizer_impl.ParametricQuantizer,
}

self._default_interm_quantizer = cfg.default_interm_quantizer
Expand Down
4 changes: 2 additions & 2 deletions qkeras/quantizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from tensorflow.keras.utils import deserialize_keras_object
from tensorflow.python.framework import smart_cond as tf_utils
from .safe_eval import safe_eval
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# from .google_internals.experimental_quantizers import quantized_bits_learnable_scale
# from .google_internals.experimental_quantizers import parametric_quantizer_d_xmax

#
# Library of auxiliary functions
Expand Down
6 changes: 3 additions & 3 deletions qkeras/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
from .quantizers import stochastic_binary
from .quantizers import stochastic_ternary
from .quantizers import ternary
# Google internal code, commented out by copybara
# Google internal code, commented out by copybara
# from .google_internals.experimental_quantizers import quantized_bits_learnable_scale
# from .google_internals.experimental_quantizers import parametric_quantizer_d_xmax
from .safe_eval import safe_eval
from tensorflow.python.ops import math_ops
from .qmac import QScaleShift
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def _add_supported_quantized_objects(custom_objects):
custom_objects["quantized_sigmoid"] = quantized_sigmoid
custom_objects["quantized_po2"] = quantized_po2
custom_objects["quantized_relu_po2"] = quantized_relu_po2
# Google internal code, commented out by copybara
# custom_objects["quantized_bits_learnable_scale"] = quantized_bits_learnable_scale

custom_objects["QConv2DBatchnorm"] = QConv2DBatchnorm
custom_objects["QDepthwiseConv2DBatchnorm"] = QDepthwiseConv2DBatchnorm
Expand Down

0 comments on commit 3d60be2

Please sign in to comment.