Gather slices from params according to indices with leading batch dims.
(params, indices, name=None)
| 3992 | "2017-10-25", "`tf.batch_gather` is deprecated, please use `tf.gather` " |
| 3993 | "with `batch_dims=-1` instead.") # pylint: disable=missing-docstring |
| 3994 | def batch_gather(params, indices, name=None): |
| 3995 | """Gather slices from params according to indices with leading batch dims.""" |
| 3996 | with ops.name_scope(name, "BatchGather", [params, indices]): |
| 3997 | indices = ops.convert_to_tensor(indices, name="indices") |
| 3998 | params = ops.convert_to_tensor(params, name="params") |
| 3999 | if indices.shape.ndims is None: |
| 4000 | raise ValueError( |
| 4001 | "batch_gather does not allow indices with unknown shape.") |
| 4002 | return _batch_gather(params, indices, batch_dims=indices.shape.ndims - 1) |
| 4003 | |
| 4004 | |
| 4005 | def _batch_gather(params, indices, batch_dims, axis=None): |
nothing calls this directly
no test coverage detected