Skip to content

Commit 0e56d30

Browse files
rino20tensorflower-gardener
authored andcommitted
Fix metric function to deliver information to api doc generator.
PiperOrigin-RevId: 419512239
1 parent 44c6505 commit 0e56d30

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tensorflow_model_optimization/python/core/keras/metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# ==============================================================================
1515
"""Implements monitoring."""
1616

17+
import functools
18+
1719
from tensorflow.python.eager import monitoring
1820

1921

@@ -61,6 +63,7 @@ def get_usage_gauge(self, name):
6163
raise ValueError('Invalid gauge name: {}'.format(name))
6264

6365
def __call__(self, func):
66+
@functools.wraps(func)
6467
def inner(*args, **kwargs):
6568
try:
6669
results = func(*args, **kwargs)

tensorflow_model_optimization/python/core/quantization/keras/quantize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def quantize_apply(
295295
quantization have already been annotated. See `quantize_annotate_model`
296296
and `quantize_annotate_layer`.
297297
298-
Quantize model.
298+
Example:
299+
299300
```python
300301
model = keras.Sequential([
301302
layers.Dense(10, activation='relu', input_shape=(100,)),

0 commit comments

Comments
 (0)