T - data type for output() output@Operator public final class Gather<T> extends PrimitiveOp implements Operand<T>
`indices` must be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shape `indices.shape + params.shape[1:]` where:
# Scalar indices
output[:, ..., :] = params[indices, :, ... :]
# Vector indices
output[i, :, ..., :] = params[indices[i], :, ... :]
# Higher rank indices
output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
If `indices` is a permutation and `len(indices) == params.shape[0]` then
this operation will permute `params` accordingly.
`validate_indices`: DEPRECATED. If this operation is assigned to CPU, values in `indices` are always validated to be within range. If assigned to GPU, out-of-bound indices result in safe but unspecified behavior, which may include raising an error.
| Modifier and Type | Class and Description |
|---|---|
static class |
Gather.Options
Optional attributes for
Gather |
operation| Modifier and Type | Method and Description |
|---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T,U extends Number> |
create(Scope scope,
Operand<T> params,
Operand<U> indices,
Gather.Options... options)
Factory method to create a class to wrap a new Gather operation to the graph.
|
Output<T> |
output() |
static Gather.Options |
validateIndices(Boolean validateIndices) |
equals, hashCode, toStringpublic static <T,U extends Number> Gather<T> create(Scope scope, Operand<T> params, Operand<U> indices, Gather.Options... options)
scope - current graph scopeparams - indices - options - carries optional attributes valuespublic static Gather.Options validateIndices(Boolean validateIndices)
validateIndices - public Output<T> asOutput()
OperandInputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput in interface Operand<T>OperationBuilder.addInput(Output)Copyright © 2015–2019. All rights reserved.