جریان تنسور:: عملیات:: ScatterDiv
#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
باشد. - indices: تانسوری از شاخص ها به بعد اول
ref
. - به روز رسانی: تانسوری از مقادیر که
ref
بر آن تقسیم می شود.
ویژگی های اختیاری (به Attrs
مراجعه کنید):
- use_locking: اگر True باشد، عملیات توسط یک قفل محافظت می شود. در غیر این صورت رفتار تعریف نشده است، اما ممکن است اختلاف کمتری از خود نشان دهد.
برمی گرداند:
-
Output
: = مشابه ref
. برای عملیاتی که میخواهند پس از انجام بهروزرسانی از مقادیر بهروزشده استفاده کنند، بهعنوان سهولت بازگردانده شد.
صفات عمومی
عملیات
Operation operation
output_ref
::tensorflow::Output output_ref
توابع عمومی
ScatterDiv
ScatterDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
ScatterDiv
ScatterDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterDiv::Attrs & attrs
)
گره
::tensorflow::Node * node() const
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
توابع استاتیک عمومی
استفاده از قفل
Attrs UseLocking(
bool x
)
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# tensorflow::ops::ScatterDiv Class Reference\n\ntensorflow::ops::ScatterDiv\n===========================\n\n`#include \u003cstate_ops.h\u003e`\n\nDivides a variable reference by sparse updates.\n\nSummary\n-------\n\nThis operation computes\n\n\n```text\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```text\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 divide.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.\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 values that `ref` is divided by.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_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/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| [ScatterDiv](#classtensorflow_1_1ops_1_1_scatter_div_1a6f5331b7d6d93eb827b6dffc9ee8ea3e)`(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| [ScatterDiv](#classtensorflow_1_1ops_1_1_scatter_div_1a7ac34a9f909edf4380d102b00e4b3667)`(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 `[ScatterDiv::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_scatter_div_1a545009b3ff38f96178cb28c10e00a19e) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_ref](#classtensorflow_1_1ops_1_1_scatter_div_1a9dd470b2028739c52eaf7d74b2f33938) | `::`[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_div_1ab42ab1d51f0a620b0c0c26e1c44dbcef)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_div_1aba889345b14720ce81925d52ebbe2d07)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_div_1a589cea85fd6873f8942f22d45f3e0022)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_scatter_div_1a1ce283b718bfb51e90d26a18d5e82722)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ScatterDiv::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/scatter-div/attrs) | Optional attribute setters for [ScatterDiv](/versions/r2.1/api_docs/cc/class/tensorflow/ops/scatter-div#classtensorflow_1_1ops_1_1_scatter_div). |\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### ScatterDiv\n\n```gdscript\n ScatterDiv(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates\n)\n``` \n\n### ScatterDiv\n\n```gdscript\n ScatterDiv(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input indices,\n ::tensorflow::Input updates,\n const ScatterDiv::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```"]]