# tensorflow::ops::QuantizeAndDequantizeV2::Attrs Struct Reference

# tensorflow::
ops::
QuantizeAndDequantizeV2::
Attrs

`
#include <array_ops.h>
`


Optional attribute setters for
[QuantizeAndDequantizeV2](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/quantize-and-dequantize-v2#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2)
.

## Summary

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a315bdca31eedd36ca93926e243fa1936 = -1 ` | ` int64 ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1adf347e0c1f8214c14d7694ae285cc9d0 = false ` | ` bool ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a11159f89f2414130b6a3ad313b27716c = 8 ` | ` int64 ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a865cf4c82b9089b872eb9b918531f2db = false ` | ` bool ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a6dfc7a75f4a69171c6497bb1edfa0d05 = "HALF_TO_EVEN" ` | ` StringPiece ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a790cd895eec69aba604ac8e9cb7f8a9f = true ` | ` bool ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a763f00e13bdab9fb43c917bbc70cf634 (int64 x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis. |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1afaceca0792d45c8137aeb043c8cfda94 (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a76057cdbc84759b92af376d7af6e5542 (int64 x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` The bitwidth of the quantization. |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a6fa06a82baf6f5d343626b0ff362f28b (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` Whether the range is given or should be determined from the ` input ` tensor. |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1abbc6241855f1eb74e6c30f9bb38a9bea (StringPiece x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` The 'round_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1acc49af3428f348e5f27485c3d72e5598 (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs ` Whether the quantization is signed or unsigned. |

## Public attributes

### axis_

```
int64 tensorflow::ops::QuantizeAndDequantizeV2::Attrs::axis_ = -1
```

### 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

### Axis

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::Axis(
  int64 x
)
```

If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis.


Defaults to -1

### 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.

<br />


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