xref: /aosp_15_r20/external/pytorch/torch/csrc/jit/passes/peephole.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/jit/ir/ir.h>
4 
5 namespace torch::jit {
6 
7 // return true if graph is modified
8 TORCH_API bool PeepholeOptimize(
9     const std::shared_ptr<Graph>& graph,
10     bool disable_shape_peepholes = false);
11 // return true if graph is modified
12 TORCH_API bool PeepholeOptimize(
13     Block* block,
14     bool disable_shape_peepholes = false);
15 // return true if graph is modified
16 TORCH_API bool FuseAddMM(const std::shared_ptr<Graph>& graph);
17 
18 } // namespace torch::jit
19