tensorflow:: ops:: GatherV2

#include <array_ops.h>

params axisからindicesに従ってスライスを収集します。

まとめ

indices任意の次元(通常は0次元または1次元)の整数テンソルである必要があります。出力テンソルの形状はparams.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:]となります。

    # Scalar indices (output is rank(params) - 1).
    output[a_0, ..., a_n, b_0, ..., b_n] =
      params[a_0, ..., a_n, indices, b_0, ..., b_n]

    # Vector indices (output is rank(params)).
    output[a_0, ..., a_n, i, b_0, ..., b_n] =
      params[a_0, ..., a_n, indices[i], b_0, ..., b_n]

    # Higher rank indices (output is rank(params) + rank(indices) - 1).
    output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
      params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]

CPUでは、範囲外のインデックスが検出された場合、エラーが返されます。GPUでは、範囲外のインデックスが検出された場合、対応する出力値に0が格納されます。

tf.batch_gatherおよびtf.gather_ndも参照してください。

議論:

  • スコープ:スコープオブジェクト
  • params: 値を取得するテンソル。少なくとも rank axis + 1である必要があります。
  • indices: インデックステンソル。範囲は[0, params.shape[axis])である必要があります。
  • axis: params内でindicesを取得する軸。デフォルトは第1次元です。負のインデックスもサポートしています。

返品:

  • Output : indicesで指定されたインデックスから収集されたparamsの値。形状はparams.shape[:axis] + indices.shape + params.shape[axis + 1:] 。

コンストラクターとデストラクタ

GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis)
GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis, const GatherV2::Attrs & attrs)

公開属性

operation
output

公的機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

BatchDims (int64 x)

構造

tensorflow:: ops:: GatherV2:: Attrs

GatherV2のオプション属性設定関数。

公開属性

手術

Operation operation

出力

::tensorflow::Output output

公的機能

ギャザーV2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis
)

ギャザーV2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis,
  const GatherV2::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

パブリック静的関数

バッチディメンション

Attrs BatchDims(
  int64 x
)