Concat
Concatenates tensors along one dimension.
Summary
Arguments:
- scope: A Scope object
- values: List of
N
Tensors to concatenate. Their ranks and types must match, and their sizes must match in all dimensions exceptconcat_dim
. - axis: 0-D. The dimension along which to concatenate. Must be in the range [-rank(values), rank(values)).
Returns:
Output
: ATensor
with the concatenation of values stacked along theconcat_dim
dimension. This tensor's shape matches that ofvalues
except inconcat_dim
where it has the sum of the sizes.
Concat 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
values
: List ofN
Tensors to concatenate. Their ranks and types must match, and their sizes must match in all dimensions exceptconcat_dim
. - StringPiece axis: 0-D. The dimension along which to concatenate. Must be in the range [-rank(values), rank(values)).
Return:
- Output output : Output object of Concat class object.
Result:
- std::vector(Tensor) result_output : The output tensor.
Using Method
※ values에 shape와 type이 모두 같은 tensor리스트가 들어오고, axis에는 리스트의 tensor를 통합할 차원을 선택한다. 위 화면의 예시 처럼 {2,2}의 shape를 가진 3개의 tensor를 리스트에 모으고, axis에 첫번째 차원을 합치기 위해 0(index번호로 0은 첫번째라는 의미)이라는 값을 입력한다. 이렇게 하면 결과 값은 {6,2}의 shape를 가진 tensor가 나온다.