- 02 7月, 2020 1 次提交
-
-
由 Zhen Wang 提交于
-
- 30 6月, 2020 1 次提交
-
-
由 Huihuang Zheng 提交于
Support Various-Length Return Grammar in Dy2stat. This PR is a follow-up of https://github.com/PaddlePaddle/Paddle/pull/25176 . The basic idea is putting no-value placeholder variables at `return` statement to make all `return` statement have same length, after that the static graph can have fixed fetch output (code at return_transformer.py). Then remove those no-value placeholder when we finally return dygraph result (code at partial_program.py). However, various length return in Bert model is still not supported. The dy2stat can change the code as I wish but some ops which check shape at compile time (e.g. Reshape, MatMul) will throw error because of the no-value-placeholder may not have the required shape. Is this a matter? To me, those no-value placeholder will be replaced as really values meeting shape requirements at run time, so I think the solution should be some way to do the compile-time checking. By the way, every time when we have dynamic shape, it often causes problem in dy2stat. We should find a way to handle it in the future. Fixing various return in Bert is my TODO thing and I will also find some other existing models for verification.
-
- 29 6月, 2020 2 次提交
-
-
由 Aurelius84 提交于
* support to save varBase created in __init__ test=develop * polish code test=develop * refine to_static_var test=develop * refine warning test=develop * add unitteset for to_static_var test=develop * fix logger test=develop * polish buffers en doc test=develop * fix param_guard test=develop * refine en doc test=develop
-
由 Huihuang Zheng 提交于
This PR added basic support for 'return' grammar in dy2stat. It supports the control flow of 'return'. The basics idea is using a return value variable to store the early return statements and boolean state variables with if-else to skip the statements after the return statements. **This PR is very basic support. There are some corner cases I didn't develop/test**. For example, 'return None', 'return different length of variables', 'return non-tensor and tensor together', 'no return statement'. **These corner cases will be done in my next PRs**. Target date is this week. **Note**: 1. for the unit test, I changed test_program_translator.py because the StaticCode of `dyfunc_with_if_else` will change. To guarantee the correctness of `dyfunc_with_if_else`, I also run it in `TestRecursiveReturn` in test_return.py. 2. I commented the early return code in bert_dygraph_model.py because 'return different length of variables' is unsupported now. I also know that there are some other models used early return and we didn't enable it in the unit test. I will add support for it in next PRs and then re-enable those tests.
-
- 24 6月, 2020 1 次提交
-
-
由 Aurelius84 提交于
* add cycle_gan_model * align train test=develop * modify image_size into 64 to avoid TimeOut test=develop * TODO in GPU test=develop
-
- 19 6月, 2020 2 次提交
-
-
由 Aurelius84 提交于
* Refine caches of converting func test=develop * fix if statement test=develop * refine cache code test=develop * rm unuse import statement test=develop * Polish code comment test=develop
-
由 Aurelius84 提交于
* Refine check_type for @declarative test=develop
-
- 18 6月, 2020 1 次提交
-
-
由 liym27 提交于
-
- 17 6月, 2020 1 次提交
-
-
由 liym27 提交于
* The arg of append() can be not Tensor temporarily. * Add Seq2Seq as ProgramTranslator Unit Test. * set dtype of vocab_size_tensor to int64 to pass Windows-CI.
-
- 11 6月, 2020 1 次提交
-
-
由 liym27 提交于
[Dy2Static]Convert var.shape stmt and Convert the return variables of Tensor-dependent 'if' staments to Tensor if it not (#24911) * Support int and long: int or long -> six.integer_types. * Modify test_tensor_shape: fix bug and modify comment. * Support convert_var_shape to convert var.shape stmt * Modify code in ifelse_simple_func.py because don't support return non-Tensor in Tensor-dependent 'if' stament currently. * Convert the return variables of Tensor-dependent 'if' staments to Tensor if it not. test=develop
-
- 09 6月, 2020 1 次提交
-
-
由 liym27 提交于
* Move function 'convert_len' to file convert_operators.py * Support that for statements are transformed to while statements. * Fix bug: raise None -> return None. * Support variable loaded and created in loop. * Use int64 in Py2 and Py3 in function to_static_variable.
-
- 05 6月, 2020 1 次提交
-
-
由 liym27 提交于
* cast var in convert_logical_XX. * Add convert_ifelse function in convert_operators.py * Add logical_transformer. Remove LogicalTransformer from loop_transformer.py * Revert modified tests in PR24799(convert_while_stmt). * Comment and modify code that doesn't support `return` statement. * Remove unnecessary class: MergeAssignTransformer, NodeTestTransformer and IfConditionVisitor in ifelse_transformer.
-
- 03 6月, 2020 3 次提交
-
-
由 Chen Weihang 提交于
* support for iter & enumerate varbase, test=develop * revert IsControlFlowVisitor change, test=develop
-
由 liym27 提交于
* Support return variable in only one of if body or else. * remove after_visit in IfElseTransformer. * Modify the result of get_name_ids in test_ifelse_basic.py * Add unittest to test the new case. * Modify code according to reviews.
-
由 liym27 提交于
* Support convert_while_loop. * Comment code that not supported 'if' in test_break_continue. * Convert int into tensor to support 'if' stmt in for/while loop. * Add unittest to test all cases of convert_logical_XX. * Add unittest to test all cases of convert_while_loop. * Fix bug in LogicalOpTransformer. test=develop
-
- 02 6月, 2020 1 次提交
-
-
由 Chen Weihang 提交于
-
- 28 5月, 2020 2 次提交
-
-
由 Aurelius84 提交于
* support nested input and output test=develop * remove code of convert type(output) in unittest test=develop * add warning test=develop
-
由 liym27 提交于
-
- 27 5月, 2020 1 次提交
-
-
由 Aurelius84 提交于
-
- 26 5月, 2020 2 次提交
-
-
由 liym27 提交于
-
由 Aurelius84 提交于
* [dy2stat] Support len * add convert_call func * refine code test=develop
-
- 21 5月, 2020 1 次提交
-
-
由 liym27 提交于
[Dy2Stat]Support to transform sequence assignments and multi-target assignments to normal assignments (#24643)
-
- 19 5月, 2020 3 次提交
-
-
由 Aurelius84 提交于
* fix bug with `if Tensor` in is_control_flow test=develop * remove continue test=develop * Support lambda and add unittest test=develop
-
由 liym27 提交于
* Support to create LoDTensorArray in control flow (cond and while_loop) * Fix bug: return LoDTensorArray in while_loop * Change code in list_transformer.py to accommodate the new features.
-
由 Chen Weihang 提交于
-
- 18 5月, 2020 1 次提交
-
-
由 Chen Weihang 提交于
* initial test * for enumerate basic implement, test=develop * update unittests, test=develop * refine unittests to adapt new training mode, test=develop * refactor for node stmts parsing code, test=develop * self-review & polish details, test=develop
-
- 15 5月, 2020 3 次提交
-
-
由 Huihuang Zheng 提交于
As the title.
-
由 Chen Weihang 提交于
* fix some print transformer problems, test=develop * simplify writing & avoid bud, test=develop * polish detail, test=develop
-
由 Aurelius84 提交于
* fix convert call globals_funcs test=develop * add import statement test=develop
-
- 14 5月, 2020 1 次提交
-
-
由 Huihuang Zheng 提交于
Add assert grammar for ProgramTranslator
-
- 13 5月, 2020 1 次提交
-
-
由 Aurelius84 提交于
* fix bug with `if Tensor` in is_control_flow test=develop * remove continue test=develop
-
- 12 5月, 2020 1 次提交
-
-
由 liym27 提交于
-
- 09 5月, 2020 2 次提交
-
-
由 Aurelius84 提交于
* support save_inference_model in program_translator test=develop * fix compatibility with OrderedDict.values() in python3 test=develop * synchronized random_seed test=develop * Polish Error Message test=develop
-
由 liym27 提交于
* [Dy2Stat] Add test for bert pretraining. * Construct fake data. * Synchronous random seed of program.
-
- 08 5月, 2020 1 次提交
-
-
由 Aurelius84 提交于
* support to train in static * support to independent decorator * remove in_dygraph_mode condition in ProgramTranslator * fix import param_guard and add train/eval test=develop * Modify into ShareVarsFromScope and rm __all__ in partial_program test=develop
-
- 06 5月, 2020 1 次提交
-
-
由 liym27 提交于
* Replace dygraph_to_static_func with @declarative or program_translator.get_func in test_list.py * Add comments in ConditionalBlock. * Support list pop last item. * Support pop the i-th item. * Support an empty tensor array as Input in assign op and set the kernel type is float.
-
- 30 4月, 2020 1 次提交
-
-
由 liym27 提交于
-
- 27 4月, 2020 1 次提交
-
-
由 Chen Weihang 提交于
* add print transformer & unify print format, test=develop * remove using of dygraph_to_static_func, test=develop * remove python stdout capture, test=develop * fix compatibility problems for PY2, test=develop * fix detail error, test=develop * fix type analysis bug, test=develop * fix print tuple compatible error in PY2, test=develop * replace get_func to declarative, test=develop * fix detail bug, test=develop * fix some detail problems, test=develop * change visit_call in print transformer, test=develop
-
- 24 4月, 2020 1 次提交
-
-
由 liym27 提交于
* Simplify code for gast.If in is_control_flow_to_transform. * Move IsControlFlowVisitor to file utils. * Don't use convert_call for build-in func in CallTransformer. * Optimize api is_control_flow_to_transform. * Polish the document of IsControlFlowVisitor.
-
- 20 4月, 2020 1 次提交
-
-
由 liym27 提交于
Fix bug in convert_call because difference exists between python3 and python2. test=develop (#23966)
-