tensorflow:: אופס:: 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 יהיה בסדר-row-major ויהיה בעל צורה זהה לקלט.

אופציה זו גם מחזירה וקטור מחוון בצורת [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, :]

טיעונים:

  • scope: אובייקט Scope
  • מדדים: 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

output_indexe

::tensorflow::Output output_indices

output_values

::tensorflow::Output output_values

reverse_index_map

::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
)