tensorflow:: אופס:: פיזור הוסף
#include <state_ops.h>
מוסיף עדכונים דלילים להפניה למשתנה.
תַקצִיר
פעולה זו מחשבת
# Scalar indices ref[indices, ...] += updates[...] # Vector indices (for each i) ref[indices[i], ...] += updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
פעולה זו מוציאה ref
לאחר ביצוע העדכון. זה מקל על שרשרת פעולות שצריכות להשתמש בערך האיפוס.
ערכים כפולים מטופלים בצורה נכונה: אם מספר indices
מפנים לאותו מיקום, התרומות שלהם מתווספות.
דורש updates.shape = indices.shape + ref.shape[1:]
או updates.shape = []
.
טיעונים:
- scope: אובייקט Scope
- ref: צריך להיות מצומת
Variable
. - מדדים: טנסור של מדדים לממד הראשון של
ref
. - עדכונים: טנסור של ערכים מעודכנים להוספה ל-
ref
.
מאפיינים אופציונליים (ראה Attrs
):
- use_locking: אם נכון, התוספת תהיה מוגנת על ידי מנעול; אחרת ההתנהגות אינה מוגדרת, אך עלולה להפגין פחות מחלוקת.
החזרות:
-
Output
: = זהה ל-ref
. הוחזר כנוחות עבור פעולות שרוצות להשתמש בערכים המעודכנים לאחר ביצוע העדכון.
בנאים והורסים | |
---|---|
ScatterAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates) | |
ScatterAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterAdd::Attrs & attrs) |
תכונות ציבוריות | |
---|---|
operation | |
output_ref |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
פונקציות סטטיות ציבוריות | |
---|---|
UseLocking (bool x) |
מבנים | |
---|---|
tensorflow:: ops:: ScatterAdd:: Attrs | קובעי תכונות אופציונליים עבור ScatterAdd . |
תכונות ציבוריות
מִבצָע
Operation operation
פלט_ref
::tensorflow::Output output_ref
תפקידים ציבוריים
פיזור הוסף
ScatterAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
פיזור הוסף
ScatterAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterAdd::Attrs & attrs )
צוֹמֶת
::tensorflow::Node * node() const
מפעיל::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
השתמש בנעילה
Attrs UseLocking( bool x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],[],null,["# tensorflow::ops::ScatterAdd Class Reference\n\ntensorflow::ops::ScatterAdd\n===========================\n\n`#include \u003cstate_ops.h\u003e`\n\nAdds sparse updates to a variable reference.\n\nSummary\n-------\n\nThis operation computes \n\n```transact-sql\n# Scalar indices\nref[indices, ...] += updates[...]\n\n# Vector indices (for each i)\nref[indices[i], ...] += updates[i, ...]\n\n# High rank indices (for each i, ..., j)\nref[indices[i, ..., j], ...] += updates[i, ..., j, ...]\n```\n\n\u003cbr /\u003e\n\nThis operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.\n\nDuplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions add.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- ref: Should be from a [Variable](/versions/r2.1/api_docs/cc/class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable) node.\n- indices: A tensor of indices into the first dimension of `ref`.\n- updates: A tensor of updated values to add to `ref`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs)):\n\n- use_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ScatterAdd](#classtensorflow_1_1ops_1_1_scatter_add_1aebad5eb3382d85a98694a67516fb31be)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` updates)` ||\n| [ScatterAdd](#classtensorflow_1_1ops_1_1_scatter_add_1a784b3e2e01f007a9c99a4bed4d2a52a7)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` updates, const `[ScatterAdd::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_scatter_add_1a3f10d947b38ba138d7b4b3841a6f86e9) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_ref](#classtensorflow_1_1ops_1_1_scatter_add_1a10b0695ddf8f2320ea456a07d4d203b6) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_scatter_add_1a1dc28df0910552341f7da76eee369656)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_add_1a038d19ab294d54a525dd26c1f4c6a44c)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_add_1af3d320c18d631efb10dafef8fc14483e)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_scatter_add_1aaf4c7b793661818e64f807275f07c01e)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ScatterAdd::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-add/attrs) | Optional attribute setters for [ScatterAdd](/versions/r2.1/api_docs/cc/class/tensorflow/ops/scatter-add#classtensorflow_1_1ops_1_1_scatter_add). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output_ref\n\n```scdoc\n::tensorflow::Output output_ref\n``` \n\nPublic functions\n----------------\n\n### ScatterAdd\n\n```gdscript\n ScatterAdd(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates\n)\n``` \n\n### ScatterAdd\n\n```gdscript\n ScatterAdd(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates,\n const ScatterAdd::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### UseLocking\n\n```text\nAttrs UseLocking(\n bool x\n)\n```"]]