tensorflow :: ops :: GatherV2
#include <array_ops.h>
indices
に従ってparams
軸axis
からスライスを収集します。
概要
indices
は、任意の次元(通常は0-Dまたは1-D)の整数テンソルである必要があります。 shape params.shape[:axis] + indices.shape + 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:値を収集するテンソル。少なくともランク
axis + 1
である必要があります。 - インデックス:インデックステンソル。範囲は
[0, params.shape[axis])
である必要があります。 - axis:
indices
を収集するためのparams
の軸。デフォルトは最初の次元です。負のインデックスをサポートします。
戻り値:
-
Output
:形状params.shape[:axis] + indices.shape + params.shape[axis + 1:]
を使用して、indexsによって指定されたindices
から収集されたparams
からの値。
コンストラクタとデストラクタ | |
---|---|
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
パブリックファンクション
GatherV2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis )
GatherV2
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
パブリック静的関数
BatchDims
Attrs BatchDims( int64 x )