# tensorflow::ops::FakeQuantWithMinMaxArgs Class Reference

# tensorflow::
ops::
FakeQuantWithMinMaxArgs

`
#include <array_ops.h>
`


Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type.

## Summary


Attributes


- `
  [min; max]
  ` define the clamping range for the `
  inputs
  ` data.
- `
  inputs
  ` values are quantized into the quantization range ( `
  [0; 2^num_bits - 1]
  ` when `
  narrow_range
  ` is false and `
  [1; 2^num_bits - 1]
  ` when it is true) and then de-quantized and output as floats in `
  [min; max]
  ` interval.
- `
  num_bits
  ` is the bitwidth of the quantization; between 2 and 16, inclusive.

<br />


Before quantization,
`
min
`
and
`
max
`
values are adjusted with the following logic. It is suggested to have
`
min <= 0 <= max
`
. If
`
0
`
is not in the range of values, the behavior can be unexpected:


- If `
  0 < min < max
  ` : `
  min_adj = 0
  ` and `
  max_adj = max - min
  ` .
- If `
  min < max < 0
  ` : `
  min_adj = min - max
  ` and `
  max_adj = 0
  ` .
- If `
  min <= 0 <= max
  ` : `
  scale = (max - min) / (2^num_bits - 1)
  ` , `
  min_adj = scale * round(min / scale)
  ` and `
  max_adj = max + min_adj - min
  ` .

<br />


Quantization is called fake since the output is still in floating point.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : The outputs tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a85e03d1dc3cd4bc32cd221b7b9cf6d9a (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input inputs) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5a50c94e0d72103df198cd3f00bed13d (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input inputs, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a74ebb70c787d9ab49c7e4f6a25a1caba ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9f9cb032ade7705f0b4a03b0ab94cb0c ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1adf0a81f8d2e49f0bf4eb5859fac39168 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a51cf8e44b3b26ce30a5016a440b99c69 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a614548643c093eefd86990ce72baece3 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5e82983f6429be0078510aea65c1593b (float x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a3fd5bd826632651830791d26c59fb56f (float x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9af5fd9211a71acf844cf8d911fde2ac (bool x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a80f557e9c790845a7e5c910bae0ef5fd (int64 x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: FakeQuantWithMinMaxArgs:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs) | Optional attribute setters for [FakeQuantWithMinMaxArgs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) . |

## Public attributes

### operation

```
Operation operation
```

### outputs

```
::tensorflow::Output outputs
```

## Public functions

### FakeQuantWithMinMaxArgs

```
 FakeQuantWithMinMaxArgs(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs
)
```

### FakeQuantWithMinMaxArgs

```
 FakeQuantWithMinMaxArgs(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  const FakeQuantWithMinMaxArgs::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### Max

```
Attrs Max(
  float x
)
```

### Min

```
Attrs Min(
  float x
)
```

### NarrowRange

```
Attrs NarrowRange(
  bool x
)
```

### NumBits

```
Attrs NumBits(
  int64 x
)
```