tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel
#include <array_ops.h> Giả lập lượng tử hóa tensor 'đầu vào' kiểu float và một trong các hình dạng: [d] ,.
Bản tóm tắt
[b, d] [b, h, w, d] thông qua các giá trị float min và max trên mỗi kênh có hình dạng [d] để xuất ra tensor có cùng hình dạng với inputs .
[min; max] xác định phạm vi giới hạn cho dữ liệu inputs . Các giá trị inputs được lượng tử hóa vào phạm vi lượng tử hóa ( [0; 2^num_bits - 1] khi narrow_range là false và [1; 2^num_bits - 1] khi nó là true) và sau đó được giải lượng tử hóa và xuất ra dưới dạng số thực trong khoảng [min; max] . num_bits là độ rộng bit của quá trình lượng tử hóa; nằm trong khoảng từ 2 đến 16, bao gồm cả hai giá trị này.
Trước khi lượng tử hóa, các giá trị min và max được điều chỉnh theo logic sau. Nên đặt min <= 0 <= max . Nếu 0 không nằm trong phạm vi giá trị, kết quả có thể không như mong đợi: Nếu 0 < min < max : min_adj = 0 và max_adj = max - min . Nếu min < max < 0 : min_adj = min - max và max_adj = 0 Nếu min <= 0 <= max : scale = (max - min) / (2^num_bits - 1) , min_adj = scale * round(min / scale) và max_adj = max + min_adj - min .
Thao tác này có độ dốc và do đó cho phép huấn luyện các giá trị min và max .
Luận điểm:
- phạm vi: Một đối tượng Phạm vi
Trả về:
-
Output: Tensor đầu ra.
Hàm khởi tạo và hàm hủy | |
|---|---|
FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max) | |
FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max, const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs) |
Thuộc tính công khai | |
|---|---|
operation | |
outputs | |
Chức năng công cộng | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Các hàm tĩnh công khai | |
|---|---|
NarrowRange (bool x) | |
NumBits (int64 x) | |
Cấu trúc | |
|---|---|
| tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs | Các thiết lập thuộc tính tùy chọn cho FakeQuantWithMinMaxVarsPerChannel . |
Thuộc tính công khai
hoạt động
Operation operation
đầu ra
::tensorflow::Output outputs
Chức năng công cộng
FakeQuantWithMinMaxVarsPerChannel
FakeQuantWithMinMaxVarsPerChannel( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max )
FakeQuantWithMinMaxVarsPerChannel
FakeQuantWithMinMaxVarsPerChannel( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max, const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs )
nút
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Phạm vi hẹp
Attrs NarrowRange( bool x )
NumBits
Attrs NumBits( int64 x )