tf.batch_gather( params, indices, name=None )
Gather slices from
params according to
indices with leading batch dims.
This operation assumes that the leading dimensions of
indices are dense,
and the gathers on the axis corresponding to the last dimension of
More concretely it computes:
result[i1, ..., in] = params[i1, ..., in-1, indices[i1, ..., in]]
params should be a Tensor of shape [A1, ..., AN, B1, ..., BM],
indices should be a Tensor of shape [A1, ..., AN-1, C] and
result will be
a Tensor of size
[A1, ..., AN-1, C, B1, ..., BM].
In the case in which indices is a 1D tensor, this operation is equivalent to
params: A Tensor. The tensor from which to gather values.
indices: A Tensor. Must be one of the following types: int32, int64. Index tensor. Must be in range
[0, params.shape[axis], where
axisis the last dimension of
name: A name for the operation (optional).
A Tensor. Has the same type as
indiceshas an unknown shape.