จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: 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 = []
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- อ้างอิง: ควรมาจากโหนด
Variable
- ดัชนี: เทนเซอร์ของดัชนีในมิติแรกของ
ref
- อัปเดต: เทนเซอร์ของค่าที่
ref
ถูกหารด้วย
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- use_locking: หากเป็น True การดำเนินการจะได้รับการปกป้องด้วยการล็อค มิฉะนั้นพฤติกรรมจะไม่ได้กำหนดไว้ แต่อาจแสดงความขัดแย้งน้อยลง
ผลตอบแทน:
-
Output
: = เหมือนกับ ref
กลับมาเพื่อความสะดวกสำหรับการดำเนินงานที่ต้องการใช้ค่าที่อัพเดตหลังจากการอัพเดตเสร็จสิ้น
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
ใช้ล็อค
Attrs UseLocking(
bool x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],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.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- ref: Should be from a [Variable](/versions/r2.3/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.3/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.3/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.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r2.3/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.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` updates, const `[ScatterDiv::Attrs](/versions/r2.3/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.3/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.3/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.3/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.3/api_docs/cc/struct/tensorflow/ops/scatter-div/attrs) | Optional attribute setters for [ScatterDiv](/versions/r2.3/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```"]]