Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: phân tánDiv
#include <state_ops.h>
Chia tham chiếu biến bằng các cập nhật thưa thớt.
Bản tóm tắt
Hoạt động này tính toán
# 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, ...]
Hoạt động này xuất ra ref
sau khi cập nhật xong. Điều này giúp chuỗi các hoạt động cần sử dụng giá trị đặt lại trở nên dễ dàng hơn.
Các mục trùng lặp được xử lý chính xác: nếu nhiều indices
tham chiếu đến cùng một vị trí, đóng góp của chúng sẽ được chia.
Yêu updates.shape = indices.shape + ref.shape[1:]
updates.shape = []
.
Lập luận:
- phạm vi: Một đối tượng phạm vi
- ref: Phải từ nút
Variable
. - chỉ số: Một tensor của các chỉ số vào chiều đầu tiên của
ref
. - cập nhật: Một tenxơ của các giá trị mà
ref
được chia cho.
Thuộc tính tùy chọn (xem Attrs
):
- use_locking: Nếu đúng, thao tác sẽ được bảo vệ bằng khóa; mặt khác, hành vi không được xác định, nhưng có thể ít gây tranh cãi hơn.
Trả về:
-
Output
: = Tương tự như ref
. Được trả về để thuận tiện cho các hoạt động muốn sử dụng các giá trị được cập nhật sau khi cập nhật xong.
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Sử dụngKhóa
Attrs UseLocking(
bool x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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```"]]