tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel
#include <array_ops.h>
Фейк-квантует тензор 'inputs' типа float по каналам.
Краткое описание
Фейк-квантует тензор inputs типа float по каналам, имеющий одну из форм: [d], [b, d][b, h, w, d] с помощью значений float по каналам min и max формы [d] в тензор outputs такой же формы, как у inputs.
Атрибуты
-
[min; max]определяют диапазон ограничения данныхinputs. -
Значения
inputsквантуются в диапазон квантования ([0; 2^num_bits - 1]когдаnarrow_rangeложно и[1; 2^num_bits - 1]когда истинно), а затем деквантуются и выводятся как числа с плавающей точкой в диапазоне[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.
Данная операция имеет градиент и, таким образом, позволяет обучаться значениям min и max.
Аргументы:
- scope: Объект Scope
Возвращает:
-
Output: Тензор вывода.
| Конструкторы и деструкторы | |
|---|---|
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) |
| Общедоступные атрибуты | |
|---|---|
operation | |
outputs | |
| Общедоступные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Общедоступные статические функции | |
|---|---|
NarrowRange(bool x) | |
NumBits(int64 x) | |
| Структуры | |
|---|---|
| tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs | Дополнительные установки атрибутов для FakeQuantWithMinMaxVarsPerChannel. |
Общедоступные атрибуты
operation
Operation operation
outputs
::tensorflow::Output outputs
Общедоступные функции
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 )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Общедоступные статические функции
NarrowRange
Attrs NarrowRange( bool x )
NumBits
Attrs NumBits( int64 x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel