tensorflow:: ops:: SparseConcat

#include <sparse_ops.h>

指定された次元に沿って、 SparseTensorのリストを連結します。

まとめ

連結は、これらの疎テンソルの密なバージョンに対して行われます。各入力は、要素が次元番号の昇順に並べられたSparseTensorであると想定されます。

連結次元を除き、すべての入力の形状は一致している必要があります。 indices 、 values 、およびshapesリストは同じ長さである必要があります。

出力形状は入力形状と同一ですが、連結方向に関しては、その方向における入力サイズの合計となります。

出力要素は、次元番号の増加方向に沿ってソート順を維持するように並べ替えられます。

この演算はO(M log M)時間で実行されます。ここでM 、すべての入力における空でない値の総数です。これは、任意の次元にわたって効率的に連結するために内部ソートが必要となるためです。

例えば、 concat_dim = 1で入力が

sp_inputs[0]: shape = [2, 3]
[0, 2]: "a"
[1, 0]: "b"
[1, 1]: "c"

sp_inputs[1]: shape = [2, 4]
[0, 1]: "d"
[0, 2]: "e"

すると出力は次のようになります

shape = [2, 7]
[0, 2]: "a"
[0, 4]: "d"
[0, 5]: "e"
[1, 0]: "b"
[1, 1]: "c"

グラフィカルに言うと、これは次のことと同じです。

[    a] concat [  d e  ] = [    a   d e  ]
[b c  ]        [       ]   [b c          ]

議論:

  • スコープ:スコープオブジェクト
  • インデックス: 2-D。各入力SparseTensorのインデックス。
  • 値: 1次元。各SparseTensorの空でない値。
  • 形状: 1次元。各SparseTensorの形状。
  • concat_dim: 連結する次元。範囲は [-rank, rank) でなければなりません。ここで rank は各入力SparseTensorの次元数です。

返品:

  • Output output_indices: 2次元。連結されたSparseTensorのインデックス。
  • Output output_values: 1次元。連結されたSparseTensorの空でない値。
  • Output output_shape: 1次元。連結されたSparseTensorの形状。

構築者と破壊者

SparseConcat (const :: tensorflow::Scope & scope, :: tensorflow::InputList indices, :: tensorflow::InputList values, :: tensorflow::InputList shapes, int64 concat_dim)

公開属性

operation
output_indices
output_shape
output_values

公開属性

手術

Operation operation

出力インデックス

::tensorflow::Output output_indices

出力形状

::tensorflow::Output output_shape

出力値

::tensorflow::Output output_values

公的機能

SparseConcat

 SparseConcat(
  const ::tensorflow::Scope & scope,
  ::tensorflow::InputList indices,
  ::tensorflow::InputList values,
  ::tensorflow::InputList shapes,
  int64 concat_dim
)