FakeQuantWithMinMaxVarsPerChannel
tensorflow C++ API
tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel
Fake-quantize the 'inputs' tensor of type float and one of the shapes: [d]
,.
Summary
[b, d][b, h, w, d]
via per-channel floatsmin
andmax
of shape[d]
to 'outputs' tensor of same shape asinputs
.
[min; max] is the clamping range for the 'inputs' data in the corresponding depth channel. Op divides this range into 255 steps (total of 256 values), then replaces each 'inputs' value with the closest of the quantized step values. 'num_bits' is the bitwidth of the quantization; between 2 and 8, inclusive.
This operation has a gradient and thus allows for trainingmin
andmax
values.
Arguments:
- scope: A Scope object
Returns:
Output
: The outputs tensor.
FakeQuantWithMinMaxVarsPerChannel block
Source link :https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_array_ops.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
- Input
inputs
: A Tensor of typefloat
. - Input min : A Tensor of type
float
. - Input max : A Tensor of type
float
. - Attr
attrs
: An optional attribute value- num_bits : An optional int. Defaults to 8.
Attrs use ex)
Output:
- output : Output object of FakeQuantWithMinMaxVarsPerChannel class object.
Result:
- std::vector(Tensor)
result_output
: ATensor
of typefloat
. This operation has a gradient and thus allows for trainingmin
andmax
values.