tensorflow::ops::ScatterUpdate
#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 หลังจากการอัปเดตเสร็จสิ้น ซึ่งจะช่วยให้การเชื่อมโยงการดำเนินการที่ต้องใช้ค่ารีเซ็ตทำได้ง่ายขึ้น
หากค่าใน ref จะต้องได้รับการอัปเดตมากกว่าหนึ่งครั้ง เนื่องจากมีรายการซ้ำกันใน indices ลำดับการอัปเดตสำหรับแต่ละค่าจึงไม่แน่นอน
ต้องใช้ updates.shape = indices.shape + ref.shape[1:] หรือ updates.shape = []

ดูเพิ่มเติม tf.batch_scatter_update และ tf.scatter_nd_update
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- อ้างอิง: ควรมาจากโหนด
Variable - ดัชนี: เทนเซอร์ของดัชนีในมิติแรกของ
ref - การอัปเดต: เทนเซอร์ของค่าที่อัปเดตแล้วที่จะเก็บไว้ใน
ref
คุณลักษณะเสริม (ดูที่ Attrs ):
- use_locking: หากเป็น True การกำหนดค่าจะถูกป้องกันด้วยการล็อก มิเช่นนั้นพฤติกรรมจะไม่แน่นอน แต่การแย่งใช้ทรัพยากรอาจน้อยลง
การส่งคืนสินค้า:
-
Output: = เหมือนกับrefส่งคืนเพื่อความสะดวกในการดำเนินการที่ต้องการใช้ค่าที่อัปเดตแล้วหลังจากทำการอัปเดตเสร็จสิ้น
ตัวสร้างและตัวทำลาย | |
|---|---|
ScatterUpdate (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates) | |
ScatterUpdate (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterUpdate::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output_ref | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
UseLocking (bool x) | |
โครงสร้าง | |
|---|---|
| tensorflow::ops::ScatterUpdate::Attrs | ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ ScatterUpdate |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต_อ้างอิง
::tensorflow::Output output_ref
หน้าที่สาธารณะ
การอัปเดตแบบกระจาย
ScatterUpdate( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
การอัปเดตแบบกระจาย
ScatterUpdate( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterUpdate::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
ใช้การล็อก
Attrs UseLocking( bool x )