# tensorflow::ops::QuantizeAndDequantizeV4::Attrs

`#include <array_ops.h>`

Optional attribute setters for [QuantizeAndDequantizeV4](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aed4f0690b8d5c0d0a6944a1befee89cb = -1` | `int64` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ac5f2d8839cbcb62a73fa09463d89dcbd = false` | `bool` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1a1a89736832fb7a8b845dd3888a83f638 = 8` | `int64` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ae1b775a9105bb3894a6cd7c98bdd0b75 = false` | `bool` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ae49e97bbf558b7ff2467e23622cd713a = "HALF_TO_EVEN"` | `StringPiece` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aa78cd1c5ab78b90114ef9aebe7488ea1 = true` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1a05346052e4983b6fc85ea4bc11c9e697(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_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/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aabdd6eed5b5efb96d92fd1744a0a2d55(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_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/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ac75f54dc51bc31498c0dd5849d544095(int64 x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs` The bitwidth of the quantization. |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aad7aaf17fdc8b303d889a10f048aaeb3(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs` Whether the range is given or should be determined from the `input` tensor. |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aa95ef25cc4ce4076b3cabebb016d690a(StringPiece x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_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/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1abef99d1c39bb4513f049554ab334f9b2(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs` Whether the quantization is signed or unsigned. |

## Public attributes

### axis_

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

### narrow_range_

```
bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::narrow_range_ = false
```

### num_bits_

```
int64 tensorflow::ops::QuantizeAndDequantizeV4::Attrs::num_bits_ = 8
```

### range_given_

```
bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::range_given_ = false
```

### round_mode_

```
StringPiece tensorflow::ops::QuantizeAndDequantizeV4::Attrs::round_mode_ = "HALF_TO_EVEN"
```

### signed_input_

```
bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::signed_input_ = true
```

## Public functions

### Axis

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::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::QuantizeAndDequantizeV4::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::QuantizeAndDequantizeV4::Attrs::NumBits(
  int64 x
)
```
The bitwidth of the quantization.

Defaults to 8

### RangeGiven

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::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::QuantizeAndDequantizeV4::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::QuantizeAndDequantizeV4::Attrs::SignedInput(
  bool x
)
```
Whether the quantization is signed or unsigned.

(actually this parameter should have been called **`signed_output`**)

Defaults to true