xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/onnx/prepare_division_for_onnx.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/jit/ir/ir.h>
4 
5 namespace torch::jit {
6 
7 // Prepare division ops for ONNX export. This is necessary for and only used
8 // by ONNX export.
9 //
10 // The pass corrects the following:
11 //
12 // - aten::div(int, int) -> float is the python truediv operator. This doesn't
13 //   exist in ONNX so we cast the ints to FloatTensors
14 //
15 TORCH_API void PrepareDivisionForONNX(const std::shared_ptr<Graph>& graph);
16 
17 } // namespace torch::jit
18