Table of Contents
Shortcuts

# FXE0015:fx-node-insert-type-promotion

This diagnostic monitors the node-level type promotion insertion process. In PyTorch, there is an automatic process called implicit type promotion, where the input types of an operator are promoted to a common type. The determination of the common type is based on the type promotion rule specific to each operator. To learn more about PyTorch’s type promotion rules, refer to the elementwise_dtypes doc and torch._refs ops.

However, implicit type promotion is not supported in ONNX. Therefore, to replicate the PyTorch behavior, we need to explicitly insert cast nodes. This diagnostic tracks the process of node-level type promotion insertion.

The type promotion rules used by this process can be found in `torch/onnx/_internal/fx/passes/type_promotion.py.` To update or add new type promotion rules, please refer to the [Note: Update type promotion rule] section.

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