tensorflow:: אופס:: SparseAdd

#include <sparse_ops.h>

מוסיף שני אובייקטים SparseTensor כדי לייצר עוד SparseTensor .

סיכום

ההנחה היא שהמדדים של אובייקטי SparseTensor הקלט מסודרים בסדר לקסיקוגרפי סטנדרטי. אם זה לא המקרה, לפני שלב זה הפעל SparseReorder כדי לשחזר את סדר האינדקס.

כברירת מחדל, אם שני ערכים מסתכמים לאפס באינדקס כלשהו, ​​הפלט SparseTensor עדיין יכלול את המיקום המסוים הזה באינדקס שלו, ושומר אפס במשבצת הערכים המקבילה. כדי לעקוף זאת, מתקשרים יכולים לציין thresh , מה שמציין שאם הסכום הוא בעל גודל קטן בהחלט מ thresh , הערך והמדד המקבילים שלו לא ייכללו. בפרט, thresh == 0 (ברירת מחדל) פירושו שהכל נשמר והסף בפועל מתרחש רק עבור ערך חיובי.

בצורות הבאות, nnz הוא הספירה לאחר התחשבות ב- thresh .

טיעונים:

  • scope: אובייקט Scope
  • a_indices: 2-D. indices של SparseTensor הראשון, גודל [nnz, ndims] מטריקס.
  • a_values: 1-D. values של SparseTensor הראשון, גודל [nnz] וקטור.
  • a_shape: 1-D. shape של SparseTensor הראשון, גודל [ndims] וקטור.
  • b_indices: 2-D. indices של SparseTensor השני, גודל [nnz, ndims] מטריקס.
  • b_values: 1-D. values של SparseTensor השני, גודל [nnz] וקטור.
  • b_shape: 1-D. shape של SparseTensor השני, גודל [ndims] וקטור.
  • סף: 0-D. סף הגודל שקובע אם זוג ערך פלט/אינדקס לוקח מקום.

החזרות:

בנאים והורסים

SparseAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input a_indices, :: tensorflow::Input a_values, :: tensorflow::Input a_shape, :: tensorflow::Input b_indices, :: tensorflow::Input b_values, :: tensorflow::Input b_shape, :: tensorflow::Input thresh)

תכונות ציבוריות

operation
sum_indices
sum_shape
sum_values

תכונות ציבוריות

מבצע

Operation operation

סכום_מדדים

::tensorflow::Output sum_indices

sum_shape

::tensorflow::Output sum_shape

sum_values

::tensorflow::Output sum_values

תפקידים ציבוריים

SparseAdd

 SparseAdd(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input a_indices,
  ::tensorflow::Input a_values,
  ::tensorflow::Input a_shape,
  ::tensorflow::Input b_indices,
  ::tensorflow::Input b_values,
  ::tensorflow::Input b_shape,
  ::tensorflow::Input thresh
)