1. 29 6月, 2020 2 次提交
    • A
      [Dy2stat]Support buffers and register_buffer in Layer (#24888) · 02adf68d
      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
      02adf68d
    • H
      [Dy2stat] Add Basic Support for Grammar 'return' (#25176) · 6f631a27
      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.
      6f631a27
  2. 28 6月, 2020 1 次提交
  3. 26 6月, 2020 1 次提交
  4. 25 6月, 2020 1 次提交
  5. 24 6月, 2020 2 次提交
  6. 23 6月, 2020 1 次提交
  7. 22 6月, 2020 2 次提交
  8. 19 6月, 2020 4 次提交
  9. 18 6月, 2020 5 次提交
  10. 17 6月, 2020 3 次提交
  11. 16 6月, 2020 4 次提交
  12. 15 6月, 2020 2 次提交
  13. 12 6月, 2020 5 次提交
  14. 11 6月, 2020 1 次提交
    • L
      [Dy2Static]Convert var.shape stmt and Convert the return variables of... · f16e2778
      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
      f16e2778
  15. 10 6月, 2020 3 次提交
  16. 09 6月, 2020 3 次提交