tensorflow::ops::SparseReduceSum
#include <sparse_ops.h>คำนวณผลรวมขององค์ประกอบต่างๆ ในมิติของ SparseTensor
สรุป
โอเปอเรเตอร์นี้รับ SparseTensor เป็นพารามิเตอร์ และเป็นตัวเทียบเคียงของ tf.reduce_sum() สำหรับ Tensor แบบสปาร์ส โดยเฉพาะอย่างยิ่ง โอเปอเรเตอร์นี้จะส่งคืน Tensor แบบหนาแน่นแทนที่จะเป็นแบบสปาร์ส
ลด sp_input ตามมิติที่ระบุใน reduction_axes หาก keep_dims ไม่เป็นจริง ค่าอันดับของเทนเซอร์จะลดลง 1 สำหรับแต่ละรายการใน reduction_axes แต่ถ้า keep_dims เป็นจริง มิติที่ลดลงจะคงไว้โดยมีความยาวเท่ากับ 1
หาก reduction_axes ไม่มีค่าใดๆ ระบบจะลดมิติข้อมูลทั้งหมด และส่งคืนเทนเซอร์ที่มีองค์ประกอบเดียว นอกจากนี้ ค่าของแกนอาจเป็นค่าลบ ซึ่งจะถูกตีความตามกฎการจัดทำดัชนีใน Python
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- input_indices: เมทริกซ์ 2 มิติ ขนาด
N x Rที่มีดัชนีของค่าที่ไม่ว่างเปล่าใน SparseTensor ซึ่งอาจไม่ได้เรียงลำดับตามแบบแผน - input_values: ค่า 1 มิติ จำนวน
Nค่าที่ไม่ว่างเปล่า ซึ่งสอดคล้องกับinput_indices - input_shape: รูปทรง 1 มิติของ SparseTensor ที่ป้อนเข้ามา
- reduction_axes: เวกเตอร์ 1 มิติ ความยาว
Kที่ประกอบด้วยแกนการลดขนาด
คุณลักษณะเสริม (ดูที่ Attrs ):
- keep_dims: ถ้าเป็นจริง จะคงขนาดที่ลดลงโดยมีความยาว 1 ไว้
การส่งคืนสินค้า:
ตัวสร้างและตัวทำลาย | |
|---|---|
SparseReduceSum (const :: tensorflow::Scope & scope, :: tensorflow::Input input_indices, :: tensorflow::Input input_values, :: tensorflow::Input input_shape, :: tensorflow::Input reduction_axes) | |
SparseReduceSum (const :: tensorflow::Scope & scope, :: tensorflow::Input input_indices, :: tensorflow::Input input_values, :: tensorflow::Input input_shape, :: tensorflow::Input reduction_axes, const SparseReduceSum::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
KeepDims (bool x) | |
โครงสร้าง | |
|---|---|
| tensorflow::ops::SparseReduceSum::Attrs | ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ SparseReduceSum |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output output
หน้าที่สาธารณะ
ลดผลรวมแบบเบาบาง
SparseReduceSum( const ::tensorflow::Scope & scope, ::tensorflow::Input input_indices, ::tensorflow::Input input_values, ::tensorflow::Input input_shape, ::tensorflow::Input reduction_axes )
ลดผลรวมแบบเบาบาง
SparseReduceSum( const ::tensorflow::Scope & scope, ::tensorflow::Input input_indices, ::tensorflow::Input input_values, ::tensorflow::Input input_shape, ::tensorflow::Input reduction_axes, const SparseReduceSum::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
คีปดิมส์
Attrs KeepDims( bool x )