tensorflow::ops::FakeQuantWithMinMaxArgs
#include <array_ops.h>ทำการสร้างควอนไทซ์ปลอมให้กับเทนเซอร์ 'อินพุต' โดยกำหนดประเภทข้อมูลเป็น float สำหรับเทนเซอร์ 'เอาต์พุต' ที่มีประเภทข้อมูลเดียวกัน
สรุป
คุณลักษณะ
-
[min; max]กำหนดช่วงการจำกัดสำหรับข้อมูลinputs - ค่า
inputsจะถูกควอนไทซ์ให้อยู่ในช่วงควอนไทซ์ ([0; 2^num_bits - 1]เมื่อnarrow_rangeเป็น false และ[1; 2^num_bits - 1]เมื่อ narrow_range เป็น true) จากนั้นจะถูกดีควอนไทซ์และส่งออกเป็นค่าทศลอยในช่วง[min; max] -
num_bitsคือความกว้างของบิตในการควอนไทเซชัน ซึ่งอยู่ระหว่าง 2 ถึง 16 รวมทั้งสองค่านี้ด้วย
ก่อนการกำหนดค่าควอนไทเซชัน ค่า min และ max จะถูกปรับโดยใช้ตรรกะดังต่อไปนี้ แนะนำให้กำหนด min <= 0 <= max หาก 0 ไม่อยู่ในช่วงค่าที่กำหนด ผลลัพธ์อาจไม่เป็นไปตามที่คาดไว้:
- ถ้า
0 < min < max:min_adj = 0และmax_adj = max - min. - ถ้า
min < max < 0:min_adj = min - maxและmax_adj = 0. - ถ้า
min <= 0 <= max:scale = (max - min) / (2^num_bits - 1),min_adj = scale * round(min / scale)และmax_adj = max + min_adj - min.
การควอนไทเซชันถูกเรียกว่าเป็นของปลอม เนื่องจากผลลัพธ์ยังคงอยู่ในรูปแบบเลขทศนิยม
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
การส่งคืนสินค้า:
-
Output: เทนเซอร์ของเอาต์พุต
ตัวสร้างและตัวทำลาย | |
|---|---|
FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs) | |
FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, const FakeQuantWithMinMaxArgs::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
outputs | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
Max (float x) | |
Min (float x) | |
NarrowRange (bool x) | |
NumBits (int64 x) | |
โครงสร้าง | |
|---|---|
| tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs | ตัวเลือกการตั้งค่าแอตทริบิวต์สำหรับ FakeQuantWithMinMaxArgs |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output outputs
หน้าที่สาธารณะ
FakeQuantWithMinMaxArgs
FakeQuantWithMinMaxArgs( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs )
FakeQuantWithMinMaxArgs
FakeQuantWithMinMaxArgs( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, const FakeQuantWithMinMaxArgs::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
แม็กซ์
Attrs Max( float x )
นาที
Attrs Min( float x )
ช่วงแคบ
Attrs NarrowRange( bool x )
นัมบิตส์
Attrs NumBits( int64 x )