forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrozen_conv_folding.h
More file actions
24 lines (18 loc) · 872 Bytes
/
frozen_conv_folding.h
File metadata and controls
24 lines (18 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include <torch/csrc/jit/ir/ir.h>
namespace torch {
namespace jit {
// Fuses Convolution -> Batchnorm into a single Convolution by
// folding batchnorm weights into conv weights.
// This pass only works on Frozen Graphs; otherwise it is a No-Op.
TORCH_API void FoldFrozenConvBatchnorm(std::shared_ptr<Graph>& graph);
// Fuses Convolution -> Add/Sub into a single Convolution by
// folding add constant tensor into conv weights.
// This pass only works on Frozen Graphs; otherwise it is a No-Op.
TORCH_API void FoldFrozenConvAddOrSub(std::shared_ptr<Graph>& graph);
// Fuses Convolution -> Mul/Div into a single Convolution by
// folding add constant tensor into conv weights.
// This pass only works on Frozen Graphs; otherwise it is a No-Op.
TORCH_API void FoldFrozenConvMulOrDiv(std::shared_ptr<Graph>& graph);
} // namespace jit
} // namespace torch