Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/3x/TensorFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TensorFlow
- [Quantization Approaches](#quantization-approaches)
- [Post Training Static Quantization](#post-training-static-quantization)
- [Smooth Quantization](#smooth-quantization)
- [Mixed Precison](#mixed-precison)
- [Mixed Precision](#mixed-precison)
- [Backend and Device](#backend-and-device)

## Introduction
Expand Down Expand Up @@ -186,7 +186,7 @@ Smooth Quantization (SQ) is an advanced quantization technique designed to optim

Refer to the [SQ Guide](./TF_SQ.md) for detailed information.

##### Mixed Precison
##### Mixed Precision
The Mixed Precision (MP) is enabled with Post Training Static Quantization. Once `BF16` is supported on machine, the matched operators will be automatically converted.


Expand Down
1 change: 1 addition & 0 deletions neural_compressor/tensorflow/keras/quantization/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

class OperatorConfig(NamedTuple):
"""The config for operator."""

config: BaseConfig
operators: List[Union[str, Callable]]
valid_func_list: List[Callable] = []
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/tensorflow/quantization/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def __init__(
scales_per_op (bool): Whether to set individual scale for every op, default is True.
record_max_info (bool): whether record the max info in model for alpha tuning, default is False.
weight_clip: Whether to clip weight when calculating scales, default is True.
auto_alpha_args(dict) : Hyperparameters used to set the alpha search space in SQ auto-tuning,
auto_alpha_args(dict) : Hyperparameters used to set the alpha search space in SQ auto-tuning,
by default the search space is 0.0-1.0 with step_size 0.1.
white_list (list): A list of supported operators of this algorithm.
"""
Expand Down
3 changes: 1 addition & 2 deletions neural_compressor/tensorflow/quantization/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""The utils for TF quantization."""
"""The utils for TF quantization."""
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The utils for rewriting graph."""
"""The utils for rewriting graph."""
1 change: 1 addition & 0 deletions neural_compressor/tensorflow/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@singleton
class TensorflowGlobalConfig:
"""A global config class for setting framework specific information."""

global_config = {
"device": "cpu",
"backend": "default",
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/tensorflow/utils/model_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def try_loading_keras(model, input_tensor_names, output_tensor_names): # pragma
model (string or tf.keras.Model): model path or tf.keras.Model object.
input_tensor_names (list of string): input tensor names of the model.
output_tensor_names (list of string): output tensor names of the model.

Returns:
graph_def (tf.compat.v1.Session): tf.compat.v1.Session object.
input_names (list of string): validated input names.
Expand Down