เทนเซอร์โฟลว์:: ปฏิบัติการ:: 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 แผนที่จากดัชนีอินพุตไปยังดัชนีเอาต์พุต

ตัวสร้างและผู้ทำลาย

SparseFillEmptyRows (const :: tensorflow::Scope & scope, :: tensorflow::Input indices, :: tensorflow::Input values, :: tensorflow::Input dense_shape, :: tensorflow::Input default_value)

คุณลักษณะสาธารณะ

empty_row_indicator
operation
output_indices
output_values
reverse_index_map

คุณลักษณะสาธารณะ

Empty_row_indicator

::tensorflow::Output empty_row_indicator

การดำเนินการ

Operation operation

เอาท์พุท_ดัชนี

::tensorflow::Output output_indices

เอาท์พุท_ค่า

::tensorflow::Output output_values

ย้อนกลับ_ดัชนี_แผนที่

::tensorflow::Output reverse_index_map

งานสาธารณะ

SparseFillEmptyRows

 SparseFillEmptyRows(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input indices,
  ::tensorflow::Input values,
  ::tensorflow::Input dense_shape,
  ::tensorflow::Input default_value
)