Created by: liym27
PR types:
New features and Bug fixes
PR changes:
dygraph to static graph
Describe:
convert_ifelse
to run the transformed code dynamically:
1. Add function - All if/else and ifExpr stmts are transformed whether it depends on Tensor or not;
- But in run-time, the code will be run in different ways (1) run paddle op like
cond
; (2) run python if/else. How it runs depends on whether it depends on Tensor.
2. Fix bug:
cast var dtype to bool in function _run_paddle_logical_XX
3. Code optimization:
3.1 Add LogicalTransformer
: move LogicalTransformer
out from LoopTransformer
and IfElseTransformer
, and run LogicalTransformer
separately.
3.2 Remove unnecessary class: MergeAssignTransformer, NodeTestTransformer and IfConditionVisitor in ifelse_transformer.py