Gather


tensorflow C++ API

tensorflow::ops::Gather

Gather slices from paramsaccording to indices.


Summary

indicesmust be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shapeindices.shape + params.shape[1:]where:

```
python Scalar indices
output[:, ..., :] = params[indices, :, ... :]

Vector indices
output[i, :, ..., :] = params[indices[i], :, ... :]

Higher rank indices
output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]

```

Ifindicesis a permutation andlen(indices) == params.shape[0]then this operation will permuteparamsaccordingly.

validate_indices: DEPRECATED. If this operation is assigned to CPU, values inindicesare 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.

Arguments:

Returns:


Gather block

Source link :https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_array_ops.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input params : A Tensor. The tensor from which to gather values.
  • Input indices:A Tensor. must be an integer tensor of any dimension (usually 0-D or 1-D). In the value of params index num.

Output:

  • output : Output object of Gather class object.

Result:

  • std::vector(Tensor) result_output: A Tensor. Has the same type as params. Values from paramsgathered from indices given by indices.

Using Method



※ 위 그림에서 설명하듯 params의 값을 indices의 index값에 맞도록 가져온다.

results matching ""

    No results matching ""