tensorflow:: ops:: ScatterNdUpdate

#include <state_ops.h>

מחיל updates דלילים על ערכים או פרוסות בודדים בתוך נתון.

תַקצִיר

משתנה לפי indices .

ref הוא Tensor עם דרגה P indices הם Tensor עם דרגה Q

indices חייבים להיות טנזור שלם, המכיל אינדקסים בתוך ref . הם חייבים להיות צורה \([d_0, ..., d_{Q-2}, K]\) כאשר 0 < K <= P

הממד הפנימי ביותר של indices (באורך K ) מתאים למדדים באלמנטים (אם K = P ) או לפרוסות (אם K < P ) לאורך הממד ה- K של ref .

updates הוא Tensor בדרגה Q-1+PK עם הצורה:

$$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$

לדוגמה, נניח שאנחנו רוצים לעדכן 4 אלמנטים מפוזרים לטנזור דרגה 1 ל-8 אלמנטים. בפייתון, עדכון זה ייראה כך:

    ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
    indices = tf.constant([[4], [3], [1] ,[7]])
    updates = tf.constant([9, 10, 11, 12])
    update = tf.scatter_nd_update(ref, indices, updates)
    with tf.Session() as sess:
      print sess.run(update)

העדכון שנוצר עבור refer ייראה כך:

[1, 11, 3, 10, 9, 6, 7, 12]

ראה tf.scatter_nd לפרטים נוספים על אופן ביצוע עדכונים לפרוסות.

ראה גם tf.scatter_update ו- tf.batch_scatter_update .

טיעונים:

  • היקף: אובייקט היקף
  • הפניה: טנזור משתנה. צריך להיות מצומת משתנה .
  • אינדקסים: טנזור . חייב להיות אחד מהסוגים הבאים: int32, int64. טנזור של אינדקסים לתוך הפניה.
  • עדכונים: טנזור . חייב להיות מאותו סוג כמו ref. טנזור של ערכים מעודכנים להוספה ל-ref.

מאפיינים אופציונליים (ראה Attrs ):

  • use_locking: ערך bool אופציונלי. ברירת המחדל היא True. אם True, ההקצאה תהיה מוגנת על ידי נעילה; אחרת ההתנהגות אינה מוגדרת, אך עשויה להפגין פחות תחרות.

החזרות:

  • Output : זהה ל-ref. מוחזר לנוחיות פעולות שרוצות להשתמש בערכים המעודכנים לאחר סיום העדכון.

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

ScatterNdUpdate (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates)
ScatterNdUpdate (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterNdUpdate::Attrs & attrs)

מאפיינים ציבוריים

operation
output_ref

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

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

פונקציות סטטיות ציבוריות

UseLocking (bool x)

מבנים

tensorflow:: ops:: ScatterNdUpdate:: Attrs

קובעי מאפיינים אופציונליים עבור ScatterNdUpdate .

מאפיינים ציבוריים

מִבצָע

Operation operation

הפלט_הפניה

::tensorflow::Output output_ref

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

ScatterNdUpdate

 ScatterNdUpdate(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates
)

ScatterNdUpdate

 ScatterNdUpdate(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates,
  const ScatterNdUpdate::Attrs & attrs
)

צוֹמֶת

::tensorflow::Node * node() const 

אופרטור::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const 

פונקציות סטטיות ציבוריות

שימוש בנעילה

Attrs UseLocking(
  bool x
)