컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: SparseAdd
#include <sparse_ops.h>
두 개의 SparseTensor
개체를 추가하여 또 다른 SparseTensor
생성합니다.
요약
입력 SparseTensor
객체의 인덱스는 표준 사전순으로 정렬된 것으로 가정됩니다. 그렇지 않은 경우 이 단계 전에 SparseReorder
실행하여 인덱스 순서를 복원하세요.
기본적으로 두 값의 합이 일부 인덱스에서 0이 되면 출력 SparseTensor
인덱스에 해당 특정 위치를 계속 포함하고 해당 값 슬롯에 0을 저장합니다. 이를 재정의하기 위해 호출자는 thresh
지정할 수 있습니다. 이는 합계의 크기가 thresh
보다 엄격하게 작은 경우 해당 값과 인덱스가 포함되지 않음을 나타냅니다. 특히 thresh == 0
(기본값)은 모든 것이 유지되고 실제 임계값 지정이 양수 값에 대해서만 발생함을 의미합니다.
다음 도형에서 nnz
는 thresh
고려한 개수입니다.
인수:
- 범위: 범위 개체
- a_indices: 2-D. 첫 번째
SparseTensor
의 indices
, 크기 [nnz, ndims]
행렬. - a_values: 1-D. 첫 번째
SparseTensor
values
, 크기 [nnz]
벡터. - a_shape: 1-D. 첫 번째
SparseTensor
의 shape
, 크기 [ndims]
벡터. - b_indices: 2-D. 두 번째
SparseTensor
의 indices
, 크기 [nnz, ndims]
행렬. - b_값: 1-D. 두 번째
SparseTensor
values
, 크기 [nnz]
벡터. - b_shape: 1-D. 두 번째
SparseTensor
의 shape
, 크기 [ndims]
벡터. - 쓰레쉬: 0-D. 출력 값/인덱스 쌍이 공간을 차지하는지 여부를 결정하는 크기 임계값입니다.
보고:
공개 속성
공공 기능
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# tensorflow::ops::SparseAdd Class Reference\n\ntensorflow::ops::SparseAdd\n==========================\n\n`#include \u003csparse_ops.h\u003e`\n\nAdds two `SparseTensor` objects to produce another `SparseTensor`.\n\nSummary\n-------\n\nThe input `SparseTensor` objects' indices are assumed ordered in standard lexicographic order. If this is not the case, before this step run [SparseReorder](/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder) to restore index ordering.\n\nBy default, if two values sum to zero at some index, the output `SparseTensor` would still include that particular location in its index, storing a zero in the corresponding value slot. To override this, callers can specify `thresh`, indicating that if the sum has a magnitude strictly smaller than `thresh`, its corresponding value and index would then not be included. In particular, `thresh == 0` (default) means everything is kept and actual thresholding happens only for a positive value.\n\nIn the following shapes, `nnz` is the count after taking `thresh` into account.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- a_indices: 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix.\n- a_values: 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector.\n- a_shape: 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector.\n- b_indices: 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix.\n- b_values: 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector.\n- b_shape: 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector.\n- thresh: 0-D. The magnitude threshold that determines if an output value/index pair takes space.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_indices\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_values\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_shape\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseAdd](#classtensorflow_1_1ops_1_1_sparse_add_1a07c65af8c10333ec7605e9a7f0a1be2b)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_shape, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_shape, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` thresh)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_add_1aab871539035af62dcf3df695fc396ba0) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sum_indices](#classtensorflow_1_1ops_1_1_sparse_add_1a935595157260ea9fcff05da3c0341947) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [sum_shape](#classtensorflow_1_1ops_1_1_sparse_add_1a573a3dbb573b8d6fb0172ca669d4685f) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [sum_values](#classtensorflow_1_1ops_1_1_sparse_add_1a2cc06856b4695dd0ba3ea4f686160ddf) | `::`[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### sum_indices\n\n```scdoc\n::tensorflow::Output sum_indices\n``` \n\n### sum_shape\n\n```scdoc\n::tensorflow::Output sum_shape\n``` \n\n### sum_values\n\n```scdoc\n::tensorflow::Output sum_values\n``` \n\nPublic functions\n----------------\n\n### SparseAdd\n\n```gdscript\n SparseAdd(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a_indices,\n ::tensorflow::Input a_values,\n ::tensorflow::Input a_shape,\n ::tensorflow::Input b_indices,\n ::tensorflow::Input b_values,\n ::tensorflow::Input b_shape,\n ::tensorflow::Input thresh\n)\n```"]]