Skip to content

Commit 8c79d5c

Browse files
Johannes Ballécopybara-github
authored andcommitted
Check static event shape rather than dynamic.
This helps with tf.function. PiperOrigin-RevId: 299952015 Change-Id: I71f4b851a4ed5316cd5aa6d3757f2dcdd59b87b7
1 parent 8bc63a0 commit 8c79d5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_compression/python/entropy_models/continuous_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, prior, coding_rank, compression=False,
6262
less precision, by using a Golomb-like code.
6363
range_coder_precision: Integer. Precision passed to the range coding op.
6464
"""
65-
if not prior.is_scalar_event():
65+
if prior.event_shape.rank:
6666
raise ValueError("`prior` must be a (batch of) scalar distribution(s).")
6767
super().__init__()
6868
self._prior = prior

0 commit comments

Comments
 (0)