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/ To update or add new type promotion rules, please refer to the [Note: Update type promotion rule] section.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources