Missed TensorFlow World? Check out the recap. Learn more

tensorflow::ops::QuantizeAndDequantizeV2::Attrs

#include <array_ops.h>

Optional attribute setters for QuantizeAndDequantizeV2.

Summary

Public attributes

narrow_range_ = false
bool
num_bits_ = 8
int64
range_given_ = false
bool
round_mode_ = "HALF_TO_EVEN"
StringPiece
signed_input_ = true
bool

Public functions

NarrowRange(bool x)
TF_MUST_USE_RESULT Attrs
If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater.
NumBits(int64 x)
TF_MUST_USE_RESULT Attrs
The bitwidth of the quantization.
RangeGiven(bool x)
TF_MUST_USE_RESULT Attrs
Whether the range is given or should be determined from the input tensor.
RoundMode(StringPiece x)
TF_MUST_USE_RESULT Attrs
The 'round_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents.
SignedInput(bool x)
TF_MUST_USE_RESULT Attrs
Whether the quantization is signed or unsigned.

Public attributes

narrow_range_

bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::narrow_range_ = false

num_bits_

int64 tensorflow::ops::QuantizeAndDequantizeV2::Attrs::num_bits_ = 8

range_given_

bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::range_given_ = false

round_mode_

StringPiece tensorflow::ops::QuantizeAndDequantizeV2::Attrs::round_mode_ = "HALF_TO_EVEN"

signed_input_

bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::signed_input_ = true

Public functions

NarrowRange

TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::NarrowRange(
  bool x
)

If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater.

i.e. for 8 bit quantization, the minimum value is -127 instead of -128.

Defaults to false

NumBits

TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::NumBits(
  int64 x
)

The bitwidth of the quantization.

Defaults to 8

RangeGiven

TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::RangeGiven(
  bool x
)

Whether the range is given or should be determined from the input tensor.

Defaults to false

RoundMode

TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::RoundMode(
  StringPiece x
)

The 'round_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents.

The following rounding modes are currently supported:

  • HALF_TO_EVEN: this is the default round_mode.
  • HALF_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7.

Defaults to "HALF_TO_EVEN"

SignedInput

TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::SignedInput(
  bool x
)

Whether the quantization is signed or unsigned.

(actually this parameter should have been called signed_output )

Defaults to true