Skip to content

Commit 6be82d1

Browse files
Johannes Ballécopybara-github
authored andcommitted
Fixes breakage involving passing a TF tensor to SciPy.
PiperOrigin-RevId: 502341769 Change-Id: I94439fc26f0567d3e700480f71f9a32dc2e8ed4c
1 parent 99864d3 commit 6be82d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_compression/python/entropy_models/universal_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def test_quantization_noise_is_uniform(self, scale):
371371
u = x - x_hat
372372
self.assertAllLessEqual(tf.abs(u), 0.5)
373373
# Check distribution has right statistics.
374-
_, p = scipy.stats.kstest(u, "uniform", (-0.5, 1.0))
374+
_, p = scipy.stats.kstest(tf.reshape(u, [-1]), "uniform", (-0.5, 1.0))
375375
self.assertGreater(p, 1e-6)
376376

377377
def test_expected_grads_or_not_gives_same_bits(self):

0 commit comments

Comments
 (0)