tfc.ops.entropy_encode_index
Stay organized with collections
Save and categorize content based on your preferences.
Encodes each input in value
according to a distribution selected by index
.
tfc.ops.entropy_encode_index(
handle, index, value, name=None
)
In general, entropy encoders in handle
reference multiple distributions.
index
selects which distribution is used to encode value
. For example, if
value
is a 3-D array, then value(i,j,k)
is encoded using the
index(i,j,k)
-th distribution. index
and value
must have the same shape.
handle
controls the number of coding streams. Suppose that value
and index
have the shape [2, 3, 4]
and that handle
has shape [2]
. Then the first
slice [0, :, :]
of shape [3, 4]
is encoded into handle[0]
and the second
slice [1, :, :]
is encoded into handle[1]
. If handle
has shape []
, then
there is only one handle, and the entire input is encoded into a single stream.
Values must be in the provided ranges specified when the input handle
was
originally created, unless overflow functionality was enabled. The handle
may
be produced by the CreateRangeEncoder
op, or may be passed through from a
different EntropyEncodeChannel/EntropyEncodeIndex
op.
Because the op modifies handle
, the corresponding input edge to the op nodes
of this type should not have other consumers in the graph.
Args |
handle
|
A Tensor of type variant .
|
index
|
A Tensor . Must be one of the following types: int32 .
|
value
|
A Tensor . Must be one of the following types: int32 .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type variant .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tfc.ops.entropy_encode_index\n\n\u003cbr /\u003e\n\nEncodes each input in `value` according to a distribution selected by `index`.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfc.entropy_encode_index`](https://www.tensorflow.org/api_docs/python/tfc/ops/entropy_encode_index)\n\n\u003cbr /\u003e\n\n tfc.ops.entropy_encode_index(\n handle, index, value, name=None\n )\n\nIn general, entropy encoders in `handle` reference multiple distributions.\n`index` selects which distribution is used to encode `value`. For example, if\n`value` is a 3-D array, then `value(i,j,k)` is encoded using the\n`index(i,j,k)`-th distribution. `index` and `value` must have the same shape.\n\n`handle` controls the number of coding streams. Suppose that `value` and `index`\nhave the shape `[2, 3, 4]` and that `handle` has shape `[2]`. Then the first\nslice `[0, :, :]` of shape `[3, 4]` is encoded into `handle[0]` and the second\nslice `[1, :, :]` is encoded into `handle[1]`. If `handle` has shape `[]`, then\nthere is only one handle, and the entire input is encoded into a single stream.\n\nValues must be in the provided ranges specified when the input `handle` was\noriginally created, unless overflow functionality was enabled. The `handle` may\nbe produced by the `CreateRangeEncoder` op, or may be passed through from a\ndifferent `EntropyEncodeChannel/EntropyEncodeIndex` op.\n\nBecause the op modifies `handle`, the corresponding input edge to the op nodes\nof this type should not have other consumers in the graph.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|----------------------------------------------------------|\n| `handle` | A `Tensor` of type `variant`. |\n| `index` | A `Tensor`. Must be one of the following types: `int32`. |\n| `value` | A `Tensor`. Must be one of the following types: `int32`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` of type `variant`. ||\n\n\u003cbr /\u003e"]]