เทนเซอร์โฟลว์:: ปฏิบัติการ:: กระจายอัปเดต

#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)

โครงสร้าง

เทนเซอร์โฟลว์ :: 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 

ตัวดำเนินการ::tensorflow::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::tensorflow::เอาต์พุต

 operator::tensorflow::Output() const 

ฟังก์ชันคงที่สาธารณะ

ใช้ล็อค

Attrs UseLocking(
  bool x
)