tensorflow::ops::Cumprod
#include <math_ops.h> คำนวณผลคูณสะสมของเทนเซอร์ x ตาม axis y
สรุป
โดยค่าเริ่มต้น ตัวดำเนินการนี้จะทำการสร้าง cumprod แบบรวม ซึ่งหมายความว่าองค์ประกอบแรกของอินพุตจะเหมือนกับองค์ประกอบแรกของเอาต์พุต:
tf.cumprod([a, b, c]) # => [a, a * b, a * b * c] โดยการตั้งค่า kwarg exclusive เป็น True จะมีการดำเนินการ cumprod พิเศษแทน:
tf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]
โดยการตั้งค่า kwarg reverse เป็น True การทำงานของ cumprod จะเกิดขึ้นในทิศทางตรงกันข้าม:
tf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c] วิธีนี้มีประสิทธิภาพมากกว่าการใช้ tf.reverse ops แยกต่างหาก
สัญลักษณ์ kwargs reverse และ exclusive สามารถใช้ร่วมกันได้เช่นกัน:
tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- x:
Tensorต้องเป็นหนึ่งในประเภทต่อไปนี้:float32,float64,int64,int32,uint8,uint16,int16,int8,complex64,complex128,qint8,quint8,qint32,half - แกน:
Tensorชนิดint32(ค่าเริ่มต้น: 0) ต้องอยู่ในช่วง[-rank(x), rank(x))
คุณลักษณะเสริม (ดูที่ Attrs ):
- เฉพาะ: ถ้า
Trueให้ทำการ cumprod แบบพิเศษ - reverse:
bool(ค่าเริ่มต้น: False)
การส่งคืนสินค้า:
-
Output: เทนเซอร์เอาต์พุต
ตัวสร้างและตัวทำลาย | |
|---|---|
Cumprod (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis) | |
Cumprod (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis, const Cumprod::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
out | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
Exclusive (bool x) | |
Reverse (bool x) | |
โครงสร้าง | |
|---|---|
| tensorflow:: ops:: Cumprod:: Attrs | ตัวเลือกการตั้งค่าแอตทริบิวต์สำหรับ Cumprod |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
ออก
::tensorflow::Output out
หน้าที่สาธารณะ
คัมโปรด
Cumprod( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis )
คัมโปรด
Cumprod( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumprod::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
พิเศษ
Attrs Exclusive( bool x )
ย้อนกลับ
Attrs Reverse( bool x )