提交 0f75cc90 authored 作者: Razvan Pascanu's avatar Razvan Pascanu 提交者: David Warde-Farley

added some high level description of the optimizations

上级 8b9b6a69
......@@ -350,6 +350,30 @@ ifelse_equilibrium = gof.EquilibriumDB()
ifelse_seqopt = gof.SequenceDB()
ifelse_equilibrium.register('seq_ifelse', ifelse_seqopt, 'fast_run',
'ifelse')
''' Comments:
I've wrote this comments to explain how the optimization of ifelse function
(for future developers that need to parse this part of code. Please try to
keep this comments in sync with whatever changes you add to the code.
ifelse optimization are registered before canonicalize !
The optimizations are called in sequence as follows:
* equilibrium shell (runs until no change):
* ifelse_lift
* ifelse_merge_ifs
* ifelse_merge_nodes
* ifelse_remove_identical_inside
* ifelse_sameCondTrue_inside
* ifelse_sameCondFalse_inside
* merge_nodes_1
* ifelse_sameCondTrue
* ifelse_sameCondFalse
* ifelse_removeIdentical
where, each of the optimization do the following things:
`ifelse_lift` (def cond_lift_single_if):
'''
optdb.register('ifelse_equilibriumOpt', ifelse_equilibrium, .5, 'fast_run',
'ifelse')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论