1#pragma once
2
3#include <torch/csrc/jit/ir/ir.h>
4
5namespace torch {
6namespace jit {
7
8// Fuses Convolution -> Batchnorm into a single Convolution by
9// folding batchnorm weights into conv weights.
10// This pass only works on Frozen Graphs; otherwise it is a No-Op.
11TORCH_API bool FoldFrozenConvBatchnorm(std::shared_ptr<Graph>& graph);
12
13// Fuses Convolution -> Add/Sub into a single Convolution by
14// folding add constant tensor into conv weights.
15// This pass only works on Frozen Graphs; otherwise it is a No-Op.
16TORCH_API bool FoldFrozenConvAddOrSub(std::shared_ptr<Graph>& graph);
17
18// Fuses Convolution -> Mul/Div into a single Convolution by
19// folding add constant tensor into conv weights.
20// This pass only works on Frozen Graphs; otherwise it is a No-Op.
21TORCH_API bool FoldFrozenConvMulOrDiv(std::shared_ptr<Graph>& graph);
22
23} // namespace jit
24} // namespace torch
25