reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-17 f7c4a3cfd07adede3308f8d9d3d7315427d90a7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once
 
#include <torch/csrc/jit/ir.h>
 
/* `getCustomPasses()` returns a vector of passes that will be executed after
 * differentiation but before any fusion.  This is the de-facto location
 * for compiler backends to insert passes.
 *
 * Static registration of a pass can be done by creating a global
 * `RegisterPass r(Pass)` variable in a compilation unit.
 *
 * pass_manager.h uses a Meyer's singleton
 * to store a vector of `Pass`es, which modify the IR graph in place.
 */
 
namespace torch {
namespace jit {
 
// A pass modifies a Graph in place.
using Pass = std::function<void(std::shared_ptr<Graph>&)>;
 
TORCH_API std::vector<Pass>& getCustomPasses();
 
struct TORCH_API RegisterPass {
  RegisterPass(Pass p);
};
 
} // namespace jit
} // namespace torch