컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: SparseFillEmpty행
#include <sparse_ops.h>
입력 2-D SparseTensor
의 빈 행을 기본값으로 채웁니다.
요약
입력 SparseTensor
입력 튜플( indices
, values
, dense_shape
)을 통해 표현됩니다. 출력 SparseTensor
는 dense_shape
는 동일하지만 index는 output_indices
및 값은 output_values
입니다.
이 작업은 값이 없는 모든 행에 대해 단일 항목을 삽입합니다. 인덱스는 [row, 0, ..., 0]
으로 생성되며 삽입된 값은 default_value
입니다.
예를 들어 sp_input
형태가 [5, 6]
이고 비어 있지 않은 값을 가지고 있다고 가정합니다.
[0, 1]: a
[0, 3]: b
[2, 0]: c
[3, 1]: d
행 1과 4는 비어 있으므로 출력은 다음 값을 포함하는 [5, 6]
모양이 됩니다.
[0, 1]: a
[0, 3]: b
[1, 0]: default_value
[2, 0]: c
[3, 1]: d
[4, 0]: default_value
출력 SparseTensor
행 우선 순서이며 입력과 동일한 모양을 갖습니다.
이 작업은 또한 다음과 같은 [dense_shape[0]]
모양의 표시기 벡터를 반환합니다.
empty_row_indicator[i] = True iff row i was an empty row.
그리고 역전파시 사용되는 [indices.shape[0]]
형태의 역방향 인덱스 맵 벡터,
reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
인수:
- 범위: 범위 개체
- 인덱스: 2-D. 희소 텐서의 인덱스.
- 값: 1-D. 희소 텐서의 값.
- 밀도_모양: 1-D. 희소 텐서의 모양.
- default_value: 0-D. 입력 희소 텐서에서 누락된 행에 대해 위치
[row, 0, ..., 0]
에 삽입할 기본값입니다. 출력 인덱스: 2-D. 채워진 희소 텐서의 인덱스.
보고:
-
Output
출력_인덱스 -
Output
출력_값: 1-D. 채워진 희소 텐서의 값. -
Output
empty_row_indicator: 1-D. 입력 희소 텐서에 조밀한 행이 누락되었는지 여부. -
Output
reverse_index_map: 1-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::SparseFillEmptyRows Class Reference\n\ntensorflow::ops::SparseFillEmptyRows\n====================================\n\n`#include \u003csparse_ops.h\u003e`\n\nFills empty rows in the input 2-D `SparseTensor` with a default value.\n\nSummary\n-------\n\nThe input `SparseTensor` is represented via the tuple of inputs (`indices`, `values`, `dense_shape`). The output `SparseTensor` has the same `dense_shape` but with indices `output_indices` and values `output_values`.\n\nThis op inserts a single entry for every row that doesn't have any values. The index is created as `[row, 0, ..., 0]` and the inserted value is `default_value`.\n\nFor example, suppose `sp_input` has shape `[5, 6]` and non-empty values: \n\n```text\n[0, 1]: a\n[0, 3]: b\n[2, 0]: c\n[3, 1]: d\n```\n\n\u003cbr /\u003e\n\nRows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values: \n\n```scdoc\n[0, 1]: a\n[0, 3]: b\n[1, 0]: default_value\n[2, 0]: c\n[3, 1]: d\n[4, 0]: default_value\n```\n\n\u003cbr /\u003e\n\nThe output `SparseTensor` will be in row-major order and will have the same shape as the input.\n\nThis op also returns an indicator vector shaped `[dense_shape[0]]` such that \n\n```transact-sql\nempty_row_indicator[i] = True iff row i was an empty row.\n```\n\n\u003cbr /\u003e\n\nAnd a reverse index map vector shaped `[indices.shape[0]]` that is used during backpropagation, \n\n```transact-sql\nreverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- indices: 2-D. the indices of the sparse tensor.\n- values: 1-D. the values of the sparse tensor.\n- dense_shape: 1-D. the shape of the sparse tensor.\n- default_value: 0-D. default value to insert into location `[row, 0, ..., 0]` for rows missing from the input sparse tensor. output indices: 2-D. the indices of the filled sparse tensor.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_indices\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_values: 1-D. the values of the filled sparse tensor.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) empty_row_indicator: 1-D. whether the dense row was missing in the input sparse tensor.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) reverse_index_map: 1-D. a map from the input indices to the output indices.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseFillEmptyRows](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a879e72f00ec2907ae24319568619e724)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` values, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` dense_shape, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` default_value)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [empty_row_indicator](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1adb1b94f12679619031e52393d4dde736) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a904fc23a9366dfb3edb6e9ce97f51176) | [Operation](/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_indices](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a2e77eb808d738a81625bc66d14e269c2) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_values](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a050f6a03931adf4b1fe9fe0933537d4f) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [reverse_index_map](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1af0519edc8137614dd36f96f10ed6e4ef) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### empty_row_indicator\n\n```scdoc\n::tensorflow::Output empty_row_indicator\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_values\n\n```scdoc\n::tensorflow::Output output_values\n``` \n\n### reverse_index_map\n\n```scdoc\n::tensorflow::Output reverse_index_map\n``` \n\nPublic functions\n----------------\n\n### SparseFillEmptyRows\n\n```gdscript\n SparseFillEmptyRows(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input indices,\n ::tensorflow::Input values,\n ::tensorflow::Input dense_shape,\n ::tensorflow::Input default_value\n)\n```"]]