เทนเซอร์โฟลว์:: ปฏิบัติการ:: เบาบางเพิ่ม
#include <sparse_ops.h> เพิ่มวัตถุ SparseTensor สองรายการเพื่อสร้าง SparseTensor อื่น
สรุป
 ดัชนีของวัตถุ SparseTensor อินพุตจะถือว่าเรียงลำดับตามลำดับพจนานุกรมมาตรฐาน หากไม่เป็นเช่นนั้น ก่อนที่ขั้นตอนนี้จะรัน SparseReorder เพื่อเรียกคืนการเรียงลำดับดัชนี
 ตามค่าเริ่มต้น หากค่าสองค่ารวมกันเป็นศูนย์ในบางดัชนี เอาต์พุต SparseTensor จะยังคงรวมตำแหน่งนั้นไว้ในดัชนี โดยจัดเก็บค่าศูนย์ในช่องค่าที่สอดคล้องกัน หากต้องการแทนที่สิ่งนี้ ผู้เรียกสามารถระบุ thresh ได้ ซึ่งบ่งชี้ว่าหากผลรวมมีขนาดเล็กกว่า thresh อย่างเคร่งครัด ค่าและดัชนีที่สอดคล้องกันก็จะไม่รวมอยู่ด้วย โดยเฉพาะอย่างยิ่ง thresh == 0 (ค่าเริ่มต้น) หมายความว่าทุกอย่างจะถูกเก็บไว้ และขีดจำกัดที่แท้จริงจะเกิดขึ้นสำหรับค่าบวกเท่านั้น
 ในรูปทรงต่อไปนี้ nnz คือการนับหลังจากคำนึงถึง thresh แล้ว
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
-  a_ดัชนี: 2-D indicesของSparseTensorตัวแรก ขนาด[nnz, ndims]Matrix
-  a_values: 1-D valuesของSparseTensorตัวแรก ขนาด[nnz]Vector
-  a_รูปร่าง: 1-D shapeของSparseTensorตัวแรก ขนาด[ndims]Vector
-  b_ดัชนี: 2-D indicesของSparseTensorตัวที่สอง ขนาด[nnz, ndims]Matrix
-  b_values: 1-D valuesของSparseTensorตัวที่สอง ขนาด[nnz]Vector
-  b_รูปร่าง: 1-D shapeของSparseTensorตัวที่สอง ขนาด[ndims]Vector
- นวดข้าว: 0-D เกณฑ์ขนาดที่กำหนดว่าค่าเอาต์พุต/คู่ดัชนีใช้พื้นที่หรือไม่
ผลตอบแทน:
| ตัวสร้างและผู้ทำลาย | |
|---|---|
| SparseAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input a_indices, :: tensorflow::Input a_values, :: tensorflow::Input a_shape, :: tensorflow::Input b_indices, :: tensorflow::Input b_values, :: tensorflow::Input b_shape, :: tensorflow::Input thresh) | 
| คุณลักษณะสาธารณะ | |
|---|---|
| operation | |
| sum_indices | |
| sum_shape | |
| sum_values | |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
sum_indices
::tensorflow::Output sum_indices
ผลรวม_รูปร่าง
::tensorflow::Output sum_shape
sum_values
::tensorflow::Output sum_values
งานสาธารณะ
เบาบางเพิ่ม
SparseAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input a_indices, ::tensorflow::Input a_values, ::tensorflow::Input a_shape, ::tensorflow::Input b_indices, ::tensorflow::Input b_values, ::tensorflow::Input b_shape, ::tensorflow::Input thresh )