1. 13 12月, 2022 1 次提交
  2. 08 12月, 2022 1 次提交
  3. 01 12月, 2022 1 次提交
  4. 30 11月, 2022 1 次提交
  5. 29 11月, 2022 1 次提交
  6. 23 10月, 2022 1 次提交
  7. 27 9月, 2022 1 次提交
  8. 02 9月, 2022 1 次提交
    • X
      [ Dy2Static ] transfer list into tensor array at runtime. (#45594) · 3be7f495
      xiongkun 提交于
      * 1. make list transformer into jit form.
      2. fix some bugs in tensor_array, such as append.
      3. enhance the function analysis visitor to recognize push/pop.
      4. add setter/getter helper to deal with 2+ name sets.
      
      * fix ci errors:
      1. add to_tensor_array logic in convert_cond
      2. fix IfExpr error.
      3. fix erros while return_names or push_pop_names is None
      4. fix slice error in a[i]=1 where a is tensor_array
      5. add pop interface in Variable
      3be7f495
  9. 12 7月, 2022 1 次提交
    • X
      [ Dy2Static ]Change NameVisitor in while to FunctionScopeAnalysis (#44155) · c5c6026e
      xiongkun 提交于
      * change NameVisitor to FunctionScopeAnalysis
      
      * polish the logic of undefined var in while_loop. create vars after body execution
      
      * replace old NameVisitor in while and fix all CI
      
      * Togather with CreateVariableTransformer
      
      * add create_variable_transformer
      
      * fix bugs
      
      * merge
      
      * fix some error, TODO: ForNodePreTransform ahead
      
      * merge for unite PR
      
      * fix conflict with base_transformer PR
      
      * fix ci errors, fix [for i in range()] error
      
      * fix according to code review
      c5c6026e
  10. 08 7月, 2022 1 次提交
  11. 06 7月, 2022 1 次提交
    • X
      [Dy2static] FunctionScopeVisitor Enhance and substitute the original NameVisitor in If (#43967) · b603dd55
      xiongkun 提交于
      * add support for control flow block analysis
      
      * move FunctionNameLivenessAnalysis into utils
      
      * pass test_ifelse.py
      
      * remove duplicate data_layer_not_check
      
      * pass the test_ifelse.py
      
      * fix unittest error .
      
      * fix all ci error in first version
      
      * temporay disable CreateVariableTransformer
      
      * fix ci errors
      
      * fix function name liveness analysis bugs
      
      * modifty def cond
      
      * fix
      
      * fix ci error - v2
      
      * fix by code review
      
      * change return_name_ids -> return_name
      b603dd55
  12. 05 7月, 2022 1 次提交
  13. 30 6月, 2022 1 次提交
  14. 28 6月, 2022 1 次提交
  15. 24 6月, 2022 1 次提交
  16. 05 6月, 2022 1 次提交
    • S
      【code format check upgrade】 step2:yapf (#42944) · a072fca8
      Sing_chan 提交于
      * use yapf to format all python file
      
      * yapf exclude two unittests file for they rely on writing and reading file, and format will break them
      
      * disable diff_py_file because too many diff files cause command following failed
      a072fca8
  17. 27 5月, 2022 1 次提交
  18. 28 3月, 2022 1 次提交
  19. 05 8月, 2021 1 次提交
  20. 09 4月, 2021 1 次提交
  21. 24 3月, 2021 1 次提交
  22. 04 3月, 2021 2 次提交
    • H
      Fix comment (#31424) · c40b98e0
      Huihuang Zheng 提交于
      Fix wrong code comment
      c40b98e0
    • H
      [Dy2stat] Fix Read-Only Attribute as while_loop Output (#31415) · 6bf02a12
      Huihuang Zheng 提交于
      Fix Read-Only Attribute as while_loop Output:
      
      Usually, our convert_while_loop will be like:
      ```
          [a, b, c] = paddle.jit.dy2static.convert_while_loop(
                  condition_name, body_name, [a, b, c])
      ```
      where a, b, c are in loop_var_names.
      
      However, if loop_var_names contains property such as foo.x, we cannot
      assign the attribute as output of convert_while_loop because Python
      property is a kind of read-only attribute. To handle the case, we replace
      the attributes which are output of convert_while_loop with generated
      variables, then if we know the attribute is not read-only at runtime, we
      assign the attribute. The created statements are like:
      ```
          [a, b, __attribute_variable_1] = paddle.jit.dy2static.convert_while_loop(
                  condition_name, body_name, [a, b, foo.x])
          if not isinstance(getattr(type(foo), x, None), property): foo.x = __attribute_variable_1
      ```
      6bf02a12
  23. 18 2月, 2021 1 次提交
    • H
      Add Support for Tuple in for Loop (#30998) · c1375783
      Huihuang Zheng 提交于
      Dy2stat didn't support tuple as iteration variable in the past. This PR added there main cases:
      
             1). Non-enumerate case: for var1, var2 in var|var.numpy() will be re-written as:
                for FOR_ITER_TUPLE_PREFIX_x in var | var.numpy():
                  var1 = FOR_ITER_TUPLE_PREFIX_x[0]
                  var2 = FOR_ITER_TUPLE_PREFIX_x[1]
              2). Enumerate out tuple case: for t in enumerate(var|var.numpy) will be rewritten as:
                for FOR_ITER_TUPLE_INDEX_PREFIX_x, FOR_ITER_TUPLE_PREFIX_x in enumerate(var|var.numpy):
                  t = (FOR_ITER_TUPLE_INDEX_PREFIX_x, FOR_ITER_TUPLE_PREFIX_x)
              3). Enumerate inner tuple case: for i, (var1, (var2, va3)) in enumerate(var|var.numpy()) will
              be re-written as:
                for i, FOR_ITER_TUPLE_PREFIX_x in var | var.numpy():
                  var1 = FOR_ITER_TUPLE_PREFIX_x[0]
                  var2 = FOR_ITER_TUPLE_PREFIX_x[1][0]
                  var3 = FOR_ITER_TUPLE_PREFIX_x[1][1]
      c1375783
  24. 21 12月, 2020 1 次提交
  25. 19 11月, 2020 2 次提交
  26. 17 11月, 2020 1 次提交
  27. 29 9月, 2020 1 次提交
    • H
      [Dy2stat] Refine Dy2stat APIs to 2.0rc (#27430) · cc2fc938
      Huihuang Zheng 提交于
      Refine Dy2stat APIs to 2.0rc
      
      After discussion, we accepted 3 key points from reviewers:
      
      1. In 2.0rc we changed dygraph_to_static folder to dy2static
      2. Keep the three files: convert_call_func.py, convert_operators.py, variable_trans_func.py
      3. Remove convert_operators path when users import convert_xxx. 
      
      After this PR, users can import convert_xxx APIs by:
      
      `import paddle.jit.dy2static.convert_xxx`
      
      The file structure will be:
      
      ```
      jit
          dy2static
                convert_operators.py
                convert_func_call.py
                variable_trans_func.py
      ```
      
      Detail changed API in files:
      
      In python/paddle/jit/dygraph_to_static/convert_call_func.py:
      from ...fluid.dygraph.dygraph_to_static.convert_call_func import convert_call  #DEFINE_ALIAS
      
      In python/paddle/jit/dygraph_to_static/convert_operators.py:
      from ...fluid.dygraph.dygraph_to_static.convert_operators import cast_bool_if_necessary  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_assert  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_ifelse  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_len  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_logical_and  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_logical_not  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_logical_or  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_print  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_var_dtype  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_var_shape  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.convert_operators import convert_while_loop  #DEFINE_ALIAS
      
      In python/paddle/jit/dygraph_to_static/variable_trans_func.py:
      from ...fluid.dygraph.dygraph_to_static.variable_trans_func import create_fill_constant_node  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.variable_trans_func import create_static_variable_gast_node  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.variable_trans_func import data_layer_not_check  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.variable_trans_func import to_static_variable  #DEFINE_ALIAS
      from ...fluid.dygraph.dygraph_to_static.variable_trans_func import to_static_variable_gast_node  #DEFINE_ALIAS
      cc2fc938
  28. 07 8月, 2020 1 次提交
  29. 18 6月, 2020 1 次提交
  30. 09 6月, 2020 1 次提交
  31. 05 6月, 2020 1 次提交
    • L
      [Dy2Static] Add convert_ifelse to run the transformed code dynamically (#24866) · a9dca580
      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. 
      a9dca580
  32. 03 6月, 2020 2 次提交
  33. 28 5月, 2020 2 次提交
  34. 26 5月, 2020 1 次提交
  35. 19 5月, 2020 1 次提交
  36. 18 5月, 2020 1 次提交
    • C
      [Dy2static] Add for enumerate Variable support (#24398) · 03ba5b74
      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
      03ba5b74