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 .
|