Skip to content

Commit eea8bf2

Browse files
relationalcopybara-github
authored andcommitted
Remove tfc.Round
Callers can instead use: tf.keras.layers.Lambda(tf.round) or tf.keras.layers.Lambda(tfc.round_st). PiperOrigin-RevId: 424283975 Change-Id: I71f555fe84884c23839e86b297266e2ae159ca67
1 parent f0f1e3a commit eea8bf2

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

tensorflow_compression/python/layers/soft_round.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,11 @@
1919

2020

2121
__all__ = [
22-
"Round",
2322
"SoftRound",
2423
"SoftRoundConditionalMean",
2524
]
2625

2726

28-
class Round(tf.keras.layers.Layer):
29-
"""Applies rounding."""
30-
31-
def call(self, inputs):
32-
return tf.round(inputs)
33-
34-
def compute_output_shape(self, input_shape):
35-
return input_shape
36-
37-
3827
class SoftRound(tf.keras.layers.Layer):
3928
"""Applies a differentiable approximation of rounding."""
4029

tensorflow_compression/python/layers/soft_round_test.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121

2222
class SoftRoundTest(tf.test.TestCase):
2323

24-
def test_round_layer_rounds(self):
25-
layer = soft_round.Round()
26-
x = tf.linspace(-5.0, 5.0, num=50)
27-
y = layer(x)
28-
self.assertAllClose(y, tf.math.round(x))
29-
3024
def test_soft_round_layer_soft_rounds(self):
3125
alpha = 5.0
3226
layer = soft_round.SoftRound(alpha=alpha)

0 commit comments

Comments
 (0)