/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/passes
NameSizeModeActions
quantization/-0755rm
utils/-0755rm
annotate_warns.h1920644editdlrm
bailout_graph.h11290644editdlrm
batch_mm.h1630644editdlrm
canonicalize.h4920644editdlrm
canonicalize_graph_fuser_ops.h1770644editdlrm
clear_profiling.h3340644editdlrm
clear_undefinedness.h8890644editdlrm
common_subexpression_elimination.h1940644editdlrm
concat_opt.h4810644editdlrm
constant_pooling.h1770644editdlrm
constant_propagation.h12870644editdlrm
create_autodiff_subgraphs.h5520644editdlrm
create_functional_graphs.h3230644editdlrm
cuda_graph_fuser.h8600644editdlrm
dead_code_elimination.h15840644editdlrm
decompose_ops.h1680644editdlrm
erase_number_types.h8130644editdlrm
fixup_trace_scope_blocks.h16730644editdlrm
fold_conv_bn.h9950644editdlrm
freeze_module.h12360644editdlrm
frozen_conv_add_relu_fusion.h2330644editdlrm
frozen_conv_folding.h8720644editdlrm
frozen_graph_optimizations.h4350644editdlrm
frozen_ops_to_mkldnn.h4140644editdlrm
fuse_linear.h5260644editdlrm
fuse_relu.h2730644editdlrm
graph_fuser.h12510644editdlrm
graph_rewrite_helper.h17850644editdlrm
guard_elimination.h3900644editdlrm
hoist_conv_packed_params.h2110644editdlrm
inliner.h1990644editdlrm
inline_autodiff_subgraphs.h2750644editdlrm
inline_forked_closures.h2410644editdlrm
inline_fork_wait.h5470644editdlrm
inplace_check.h1680644editdlrm
insert_guards.h4530644editdlrm
integer_value_refinement.h2340644editdlrm
lift_closures.h2360644editdlrm
liveness.h6630644editdlrm
loop_unrolling.h10060644editdlrm
lower_grad_of.h3480644editdlrm
lower_graph.h7500644editdlrm
lower_tuples.h6660644editdlrm
metal_rewrite.h6060644editdlrm
normalize_ops.h5360644editdlrm
onnx.h9670644editdlrm
pass_manager.h46350644editdlrm
peephole.h5070644editdlrm
peephole_alias_sensitive.h3550644editdlrm
peephole_dict_idioms.h10000644editdlrm
peephole_list_idioms.h20030644editdlrm
peephole_non_tensor.h3420644editdlrm
prepack_folding.h3580644editdlrm
remove_dropout.h2800644editdlrm
remove_exceptions.h9540644editdlrm
remove_expands.h1750644editdlrm
remove_inplace_ops.h2960644editdlrm
remove_mutation.h26740644editdlrm
remove_redundant_profiles.h1960644editdlrm
requires_grad_analysis.h2600644editdlrm
restore_mutation.h18870644editdlrm
shape_analysis.h4630644editdlrm
specialize_autogradzero.h6560644editdlrm
subgraph_rewrite.h41120644editdlrm
symbolic_shape_analysis.h6410644editdlrm
tensorexpr_fuser.h20770644editdlrm
update_differentiable_graph_requires_grad.h7400644editdlrm
value_refinement_utils.h26690644editdlrm
variadic_ops.h9930644editdlrm
vulkan_rewrite.h5760644editdlrm
xnnpack_rewrite.h9170644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/passes/pass_manager.h (4635B)
#pragma once #include /* `getCustomPrePasses()` 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. * * `getCustomPostPasses()` returns a vector of passes that will be * executed after differentiation and after fusion (if any). This is the * location for fusion cleanup passes if they are needed. * * Static registration of a pass can be done by creating a global * `Register{Pre,Post}Pass 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 GraphPass = std::function&)>; // Since Passes are std::functions, we associate a UUID to each pass, this way // if we want to deregister a pass, we have something to reference it by. using GraphPassNameType = unsigned int; // Start UUID at 1 static GraphPassNameType graphPassID = 1; // Graph pass entries have a name associated with them using GraphPassEntry = std::pair; // Return currently registered passes. Passes are stored in a static vector TORCH_API std::vector>& getCustomPostPasses(); TORCH_API std::vector>& getCustomPrePasses(); TORCH_API GraphPassNameType registerPostPass(GraphPass p); TORCH_API GraphPassNameType registerPrePass(GraphPass p); // Look up pass by name passed in, remove it from registered passes TORCH_API void clearPostPass(GraphPassNameType p); TORCH_API void clearPrePass(GraphPassNameType p); // Remove all passes TORCH_API void clearAllPostPasses(); TORCH_API void clearAllPrePasses(); // LEGACY CALL struct TORCH_API RegisterPostPass { RegisterPostPass(GraphPass p); }; using RegisterPass = RegisterPostPass; /* * PassManager is a wrapper on the register/clear PostPass functions above. It * will register the pass provided in "registerPass" and will hold on to its * associated name that way clearPass can be later called and will delete the * pass used to register when called. * * PassManager is templated because we want static variables based on a * particular GraphPass. When deriving from PassManager, you should send as the * template parameter your derived class as you would for the curiously * recurring template pattern. This template parameter isn't actually used and * is simply done to prevent static members from being shared across derived * types. */ template struct C10_EXPORT PassManager { private: // We want this class to be abstract because it's virtual void abstract() = 0; protected: /* * isRegistered() will return if a pass has been registered * isRegistered(true) will change the value of the internal static bool * * There's an internal static bool to this function to keep track of the * state, this is so when functions are derived from this class, they don't * have to worry about initializing the static members. */ static bool isRegistered(bool flip_bit = false) { static bool val = false; if (flip_bit) val = !val; return val; } /* * name() will return the name of the registered pass * name(pass_name, true) will set the name of the pass * Similarly to isRegistered we use an internal static variable to hold the * name. */ static GraphPassNameType passID( GraphPassNameType PassID = 0, bool set = false) { static GraphPassNameType pass_id = 0; if (set) pass_id = PassID; return pass_id; } public: // registerPass(pass) will register the pass provided and set the // name/isRegistered functions appropriately, it returns a bool value // indicating whether the given pass is already registered previously. static bool registerPass(GraphPass p) { if (!isRegistered()) { // If we don't already have a registered pass, register pass // hold on to its name, change isRegistered to true passID(registerPostPass(std::move(p)), true); isRegistered(true); return false; } return true; } // Calls ClearPostPass(passID()) static void clearPass() { // If the pass is registered, clear it and change isRegistered to false. if (isRegistered()) { clearPostPass(passID()); isRegistered(true); } } // clang-tidy requires virtual destructor; virtual ~PassManager() = default; }; } // namespace jit } // namespace torch