Skip to content

Commit 91a6254

Browse files
lucastheiscopybara-github
authored andcommitted
Disable variable shape check for better interoperability with SavedModel().
PiperOrigin-RevId: 461452867 Change-Id: Ib9c6b2d7719fd8af28fdbebadf88060d8c059d75
1 parent 4d719e7 commit 91a6254

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tensorflow_compression/python/entropy_models/continuous_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,11 @@ def _init_compression(self, cdf, cdf_offset, cdf_shapes):
209209
cdf_offset, dtype=tf.int32, name="cdf_offset")
210210
else:
211211
self._cdf = tf.Variable(
212-
cdf, dtype=tf.int32, trainable=False, name="cdf")
212+
cdf, dtype=tf.int32, trainable=False, name="cdf",
213+
validate_shape=False, shape=[None])
213214
self._cdf_offset = tf.Variable(
214-
cdf_offset, dtype=tf.int32, trainable=False, name="cdf_offset")
215+
cdf_offset, dtype=tf.int32, trainable=False, name="cdf_offset",
216+
validate_shape=False, shape=[None])
215217

216218
def _build_tables(self, prior, precision, offset=None):
217219
"""Computes integer-valued probability tables used by the range coder.

0 commit comments

Comments
 (0)