จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: SparseFillEmptyRows
#include <sparse_ops.h>
เติมแถวว่างในการป้อนข้อมูล 2-D SparseTensor
ด้วยค่าเริ่มต้น
สรุป
อินพุต SparseTensor
ถูกแสดงผ่านทูเพิลของอินพุต ( indices
values
dense_shape
) เอาต์พุต SparseTensor
มี dense_shape
เหมือนกัน แต่มีดัชนี 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
จะอยู่ในลำดับแถวหลักและจะมีรูปร่างเหมือนกับอินพุต
op นี้ยังส่งคืนเวกเตอร์ตัวบ่งชี้ที่มีรูปร่าง [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
ท output_values: 1-D ค่าของเทนเซอร์กระจัดกระจายที่เต็มไป -
Output
Empty_row_indicator: 1-D ไม่ว่าแถวหนาแน่นจะหายไปในเซ็นเซอร์กระจัดกระจายอินพุตหรือไม่ -
Output
Reverse_index_map: 1-D แผนที่จากดัชนีอินพุตไปยังดัชนีเอาต์พุต
คุณลักษณะสาธารณะ
งานสาธารณะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ 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```"]]