xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/inline_fork_wait.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/jit/ir/ir.h>
4 
5 namespace torch::jit {
6 
7 // Inline Fork and Wait calls. This is used, for example, in ONNX export, where
8 // we do not support the explicit parallelism structures and would rather
9 // just have a flat graph. This inlines the forked section in the fork()
10 // callsite and replaces uses of the result of wait() calls with the values
11 // produced from the (now-inlined) forked section.
12 TORCH_API void InlineForkWait(const std::shared_ptr<Graph>& graph);
13 
14 } // namespace torch::jit
15