@@ -21,7 +21,7 @@ description: Indexed entropy model for continuous random variables.
2121
2222<table class =" tfo-notebook-buttons tfo-api nocontent " align =" left " >
2323<td >
24- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L30-L408 " >
24+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L30-L420 " >
2525 <img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
2626 View source on GitHub
2727 </a >
@@ -36,7 +36,8 @@ Indexed entropy model for continuous random variables.
3636<code >tfc.ContinuousIndexedEntropyModel(
3737 prior_fn, index_ranges, parameter_fns, coding_rank, channel_axis=-1,
3838 compression=False, stateless=False, expected_grads=False, tail_mass=(2 ** -8),
39- range_coder_precision=12, dtype=tf.float32, laplace_tail_mass=0
39+ range_coder_precision=12, bottleneck_dtype=None, prior_dtype=tf.float32,
40+ laplace_tail_mass=0
4041)
4142</code ></pre >
4243
@@ -247,11 +248,19 @@ Integer. Precision passed to the range coding op.
247248</td >
248249</tr ><tr >
249250<td >
250- ` dtype `
251+ ` bottleneck_dtype `
251252</td >
252253<td >
253- ` tf.dtypes.DType ` . Data type of this entropy model (i.e. dtype of
254- prior, decompressed values).
254+ ` tf.dtypes.DType ` . Data type of bottleneck tensor.
255+ Defaults to ` tf.keras.mixed_precision.global_policy().compute_dtype ` .
256+ </td >
257+ </tr ><tr >
258+ <td >
259+ ` prior_dtype `
260+ </td >
261+ <td >
262+ ` tf.dtypes.DType ` . Data type of prior and probability
263+ computations. Defaults to ` tf.float32 ` .
255264</td >
256265</tr ><tr >
257266<td >
@@ -275,6 +284,13 @@ laplace mixture for training stability. (experimental)
275284
276285<tr >
277286<td >
287+ ` bottleneck_dtype `
288+ </td >
289+ <td >
290+ Data type of the bottleneck tensor.
291+ </td >
292+ </tr ><tr >
293+ <td >
278294` cdf `
279295</td >
280296<td >
@@ -310,13 +326,6 @@ Whether this entropy model is prepared for compression.
310326</td >
311327</tr ><tr >
312328<td >
313- ` dtype `
314- </td >
315- <td >
316- Data type of this entropy model.
317- </td >
318- </tr ><tr >
319- <td >
320329` expected_grads `
321330</td >
322331<td >
@@ -380,6 +389,13 @@ Prior distribution, used for deriving range coding tables.
380389</td >
381390</tr ><tr >
382391<td >
392+ ` prior_dtype `
393+ </td >
394+ <td >
395+ Data type of ` prior ` .
396+ </td >
397+ </tr ><tr >
398+ <td >
383399` prior_fn `
384400</td >
385401<td >
@@ -461,7 +477,7 @@ of calling this method if you don't expect the return value to change.
461477
462478<h3 id =" compress " ><code >compress</code ></h3 >
463479
464- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L338-L369 " >View source</a >
480+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L349-L381 " >View source</a >
465481
466482<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
467483<code >compress(
@@ -523,7 +539,7 @@ coding unit.
523539
524540<h3 id =" decompress " ><code >decompress</code ></h3 >
525541
526- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L371-L397 " >View source</a >
542+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L383-L409 " >View source</a >
527543
528544<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
529545<code >decompress(
@@ -577,7 +593,7 @@ dimension).
577593
578594<h3 id =" from_config " ><code >from_config</code ></h3 >
579595
580- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L404-L408 " >View source</a >
596+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L416-L420 " >View source</a >
581597
582598<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
583599<code >@classmethod</code >
@@ -591,7 +607,7 @@ Instantiates an entropy model from a configuration dictionary.
591607
592608<h3 id =" get_config " ><code >get_config</code ></h3 >
593609
594- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L399-L402 " >View source</a >
610+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L411-L414 " >View source</a >
595611
596612<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
597613<code >get_config()
@@ -602,7 +618,7 @@ Returns the configuration of the entropy model.
602618
603619<h3 id =" get_weights " ><code >get_weights</code ></h3 >
604620
605- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L339- L340 " >View source</a >
621+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L340-L341 " >View source</a >
606622
607623<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
608624<code >get_weights()
@@ -613,7 +629,7 @@ Returns the configuration of the entropy model.
613629
614630<h3 id =" quantize " ><code >quantize</code ></h3 >
615631
616- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L320-L336 " >View source</a >
632+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L330-L347 " >View source</a >
617633
618634<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
619635<code >quantize(
@@ -662,7 +678,7 @@ A `tf.Tensor` containing the quantized values.
662678
663679<h3 id =" set_weights " ><code >set_weights</code ></h3 >
664680
665- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L342-L347 " >View source</a >
681+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_base.py#L343-L348 " >View source</a >
666682
667683<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
668684<code >set_weights(
@@ -738,7 +754,7 @@ The original method wrapped such that it enters the module's name scope.
738754
739755<h3 id =" __call__ " ><code >__call__</code ></h3 >
740756
741- <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L277-L318 " >View source</a >
757+ <a target =" _blank " href =" https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/entropy_models/continuous_indexed.py#L286-L328 " >View source</a >
742758
743759<pre class =" devsite-click-to-copy prettyprint lang-py tfo-signature-link " >
744760<code >__call__(
0 commit comments