From dcb5f921ded02afb5e404409dcc98d02d55f8ae3 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Mon, 8 Jun 2020 15:43:53 +0100 Subject: [PATCH] Add clustering module to API docs generator --- .../python/core/api/__init__.py | 1 + .../python/core/api/clustering/__init__.py | 16 ++++++++++++++ .../core/api/clustering/keras/__init__.py | 22 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 tensorflow_model_optimization/python/core/api/clustering/__init__.py create mode 100644 tensorflow_model_optimization/python/core/api/clustering/keras/__init__.py diff --git a/tensorflow_model_optimization/python/core/api/__init__.py b/tensorflow_model_optimization/python/core/api/__init__.py index 93e16e523..107276896 100644 --- a/tensorflow_model_optimization/python/core/api/__init__.py +++ b/tensorflow_model_optimization/python/core/api/__init__.py @@ -13,5 +13,6 @@ # limitations under the License. # ============================================================================== """Import API modules for Tensorflow Model Optimization.""" +from tensorflow_model_optimization.python.core.api import clustering from tensorflow_model_optimization.python.core.api import quantization from tensorflow_model_optimization.python.core.api import sparsity diff --git a/tensorflow_model_optimization/python/core/api/clustering/__init__.py b/tensorflow_model_optimization/python/core/api/clustering/__init__.py new file mode 100644 index 000000000..9fd39bd34 --- /dev/null +++ b/tensorflow_model_optimization/python/core/api/clustering/__init__.py @@ -0,0 +1,16 @@ +# Copyright 2020 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. +# ============================================================================== +"""Module containing code for clustering.""" +from tensorflow_model_optimization.python.core.api.clustering import keras diff --git a/tensorflow_model_optimization/python/core/api/clustering/keras/__init__.py b/tensorflow_model_optimization/python/core/api/clustering/keras/__init__.py new file mode 100644 index 000000000..c1be4b95b --- /dev/null +++ b/tensorflow_model_optimization/python/core/api/clustering/keras/__init__.py @@ -0,0 +1,22 @@ +# Copyright 2020 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. +# ============================================================================== +"""Module containing clustering code built on Keras abstractions.""" +# pylint: disable=g-bad-import-order +from tensorflow_model_optimization.python.core.clustering.keras.cluster import cluster_scope +from tensorflow_model_optimization.python.core.clustering.keras.cluster import cluster_weights +from tensorflow_model_optimization.python.core.clustering.keras.cluster import strip_clustering + +from tensorflow_model_optimization.python.core.clustering.keras.cluster_config import CentroidInitialization +# pylint: enable=g-bad-import-order