تدفق التوتر:: العمليات:: ScatterMul
#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 = []
.
الحجج:
- النطاق: كائن النطاق
- المرجع: يجب أن يكون من عقدة
Variable
. - المؤشرات: موتر من المؤشرات في البعد الأول من
ref
. - التحديثات: موتر القيم المحدثة المراد ضربها في
ref
.
السمات الاختيارية (انظر Attrs
):
- use_locking: إذا كان True، فسيتم حماية العملية بواسطة قفل؛ وإلا فإن السلوك غير محدد، ولكنه قد يحمل قدرًا أقل من الخلاف.
العوائد:
-
Output
: = نفس ref
. يتم إرجاعها لتسهيل العمليات التي تريد استخدام القيم المحدثة بعد الانتهاء من التحديث.
الصفات العامة
عملية
Operation operation
input_ref
::tensorflow::Output output_ref
الوظائف العامة
ScatterMul
ScatterMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
ScatterMul
ScatterMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterMul::Attrs & attrs
)
العقدة
::tensorflow::Node * node() const
operator::tensorflow::Input() const
المشغل::tensorflow::الإخراج
operator::tensorflow::Output() const
وظائف ثابتة العامة
UseLocking
Attrs UseLocking(
bool x
)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::ScatterMul Class Reference\n\ntensorflow::ops::ScatterMul\n===========================\n\n`#include \u003cstate_ops.h\u003e`\n\nMultiplies sparse updates into a variable reference.\n\nSummary\n-------\n\nThis operation computes\n\n\n```scdoc\n # Scalar indices\n ref[indices, ...] *= updates[...]\n```\n\n\u003cbr /\u003e\n\n\n```transact-sql\n # Vector indices (for each i)\n ref[indices[i], ...] *= updates[i, ...]\n```\n\n\u003cbr /\u003e\n\n\n```scdoc\n # High rank indices (for each i, ..., j)\n ref[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 multiply.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- ref: Should be from a [Variable](/versions/r1.15/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 multiply to `ref`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs)):\n\n- use_locking: If True, the operation 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/r1.15/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| [ScatterMul](#classtensorflow_1_1ops_1_1_scatter_mul_1a7db6b5ac554e784855d78d429e7574e3)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` updates)` ||\n| [ScatterMul](#classtensorflow_1_1ops_1_1_scatter_mul_1a59f4787f45824ffa7053c4184caea38f)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` updates, const `[ScatterMul::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_scatter_mul_1a3e2e0e89df1f658634f7268ac3785dd8) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_ref](#classtensorflow_1_1ops_1_1_scatter_mul_1a6c4d285e1c8631ca2fad4529c134bd60) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_scatter_mul_1a643d99a44650276080fea233a3649261)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_mul_1a1c452250deb719e0fea5fb0714fa7231)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_mul_1ab7c16cd28461b1d78e7b1d1efd4811da)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_scatter_mul_1aaacc375e6d81db93be7d7823990b3b9b)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ScatterMul::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/scatter-mul/attrs) | Optional attribute setters for [ScatterMul](/versions/r1.15/api_docs/cc/class/tensorflow/ops/scatter-mul#classtensorflow_1_1ops_1_1_scatter_mul). |\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### ScatterMul\n\n```gdscript\n ScatterMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates\n)\n``` \n\n### ScatterMul\n\n```gdscript\n ScatterMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates,\n const ScatterMul::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```"]]