Table of Contents
Shortcuts

# DTypeWithConstraints

class torch.ao.quantization.backend_config.DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exact_match=None)

  Config for specifying additional constraints for a given dtype, such as quantization value ranges, scale value ranges, and fixed quantization params, to be used in `DTypeConfig`.

  The constraints currently supported are:

  - quant_min_lower_bound and quant_max_upper_bound: Lower and upper bounds for the minimum and maximum quantized values respectively. If the QConfig’s quant_min and quant_max fall outside this range, then the QConfig will be ignored.

  - scale_min_lower_bound and scale_max_upper_bound: Lower and upper bounds for the minimum and maximum scale values respectively. If the QConfig’s minimum scale value (currently exposed as eps) falls below the lower bound, then the QConfig will be ignored. Note that the upper bound is currently not enforced.

  - scale_exact_match and zero_point_exact_match: Exact match requirements for scale and zero point, to be used for operators with fixed quantization parameters such as sigmoid and tanh. If the observer specified in the QConfig is neither FixedQParamsObserver nor FixedQParamsFakeQuantize, or if the quantization parameters don’t match, then the QConfig will be ignored.

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.