컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 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-D. 각
SparseTensor
의 비어 있지 않은 값. - 모양: 1-D. 각
SparseTensor
의 모양. - concat_dim: 연결할 차원입니다. [-순위, 순위) 범위 내에 있어야 합니다. 여기서 순위는 각 입력
SparseTensor
의 차원 수입니다.
보고:
-
Output
출력_인덱스: 2-D. 연결된 SparseTensor
의 인덱스입니다. -
Output
출력_값: 1-D. 연결된 SparseTensor
의 비어 있지 않은 값입니다. -
Output
출력_모양: 1-D. 연결된 SparseTensor
의 모양입니다.
공개 속성
공공 기능
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# tensorflow::ops::SparseConcat Class Reference\n\ntensorflow::ops::SparseConcat\n=============================\n\n`#include \u003csparse_ops.h\u003e`\n\nConcatenates a list of `SparseTensor` along the specified dimension.\n\nSummary\n-------\n\nConcatenation is with respect to the dense versions of these sparse tensors. It is assumed that each input is a `SparseTensor` whose elements are ordered along increasing dimension number.\n\n[All](/versions/r2.3/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) inputs' shapes must match, except for the concat dimension. The `indices`, `values`, and `shapes` lists must have the same length.\n\nThe output shape is identical to the inputs', except along the concat dimension, where it is the sum of the inputs' sizes along that dimension.\n\nThe output elements will be resorted to preserve the sort order along increasing dimension number.\n\nThis op runs in `O(M log M)` time, where `M` is the total number of non-empty values across all inputs. This is due to the need for an internal sort in order to concatenate efficiently across an arbitrary dimension.\n\nFor example, if `concat_dim = 1` and the inputs are \n\n```scdoc\nsp_inputs[0]: shape = [2, 3]\n[0, 2]: \"a\"\n[1, 0]: \"b\"\n[1, 1]: \"c\"\n\nsp_inputs[1]: shape = [2, 4]\n[0, 1]: \"d\"\n[0, 2]: \"e\"\n```\n\n\u003cbr /\u003e\n\nthen the output will be \n\n```text\nshape = [2, 7]\n[0, 2]: \"a\"\n[0, 4]: \"d\"\n[0, 5]: \"e\"\n[1, 0]: \"b\"\n[1, 1]: \"c\"\n```\n\n\u003cbr /\u003e\n\nGraphically this is equivalent to doing \n\n```ini\n[ a] concat [ d e ] = [ a d e ]\n[b c ] [ ] [b c ]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- indices: 2-D. Indices of each input `SparseTensor`.\n- values: 1-D. Non-empty values of each `SparseTensor`.\n- shapes: 1-D. Shapes of each `SparseTensor`.\n- concat_dim: Dimension to concatenate along. Must be in range \\[-rank, rank), where rank is the number of dimensions in each input `SparseTensor`.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_indices: 2-D. Indices of the concatenated `SparseTensor`.\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_values: 1-D. Non-empty values of the concatenated `SparseTensor`.\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_shape: 1-D. Shape of the concatenated `SparseTensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseConcat](#classtensorflow_1_1ops_1_1_sparse_concat_1a50aa275ec5a88496fd4e99f0f1003616)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::InputList](/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` indices, ::`[tensorflow::InputList](/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` values, ::`[tensorflow::InputList](/versions/r2.3/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` shapes, int64 concat_dim)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_concat_1a8db5a398751bcf0e460c5032ae1ab292) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_indices](#classtensorflow_1_1ops_1_1_sparse_concat_1a79b9cef174b8488e90f52907d6d64a0f) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_shape](#classtensorflow_1_1ops_1_1_sparse_concat_1ae3130991367ac10382b9a6a310b1eff5) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_values](#classtensorflow_1_1ops_1_1_sparse_concat_1a626bd96bc86fb8ecddbd8cbb7a6828cf) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output_indices\n\n```scdoc\n::tensorflow::Output output_indices\n``` \n\n### output_shape\n\n```scdoc\n::tensorflow::Output output_shape\n``` \n\n### output_values\n\n```scdoc\n::tensorflow::Output output_values\n``` \n\nPublic functions\n----------------\n\n### SparseConcat\n\n```gdscript\n SparseConcat(\n const ::tensorflow::Scope & scope,\n ::tensorflow::InputList indices,\n ::tensorflow::InputList values,\n ::tensorflow::InputList shapes,\n int64 concat_dim\n)\n```"]]