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

#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 กลับมาเพื่อความสะดวกสำหรับการดำเนินงานที่ต้องการใช้ค่าที่อัพเดตหลังจากการอัพเดตเสร็จสิ้น

ตัวสร้างและผู้ทำลาย

ScatterAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates)
ScatterAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterAdd::Attrs & attrs)

คุณลักษณะสาธารณะ

operation
output_ref

งานสาธารณะ

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

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

UseLocking (bool x)

โครงสร้าง

เทนเซอร์โฟลว์ :: ops :: ScatterAdd :: Attrs

ตัวตั้งค่าแอ็ตทริบิวต์ทางเลือกสำหรับ ScatterAdd

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

เอาท์พุท_อ้างอิง

::tensorflow::Output output_ref

งานสาธารณะ

กระจายเพิ่ม

 ScatterAdd(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates
)

กระจายเพิ่ม

 ScatterAdd(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates,
  const ScatterAdd::Attrs & attrs
)

โหนด

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const 

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

ใช้ล็อค

Attrs UseLocking(
  bool x
)