1. 06 9月, 2022 1 次提交
  2. 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
  3. 26 8月, 2022 1 次提交
    • X
      [ Dy2static ] select input fix and while_op memory bug fixed. (#45380) · 91298884
      xiongkun 提交于
      * while support for python container.
      It is convenient to convert more dynamic graph codes into static graphs.
      
      * cond support python container
      
      * 1. make select_input output shape = input[1]
      2. add warning in while_loop risky assign
      
      * fix 2 problem in GPT export:
      1. a bug in while_op no_need_copy_var, which causes gpu memory leakage
      2. a bug in undefined_var where the stop_gradient should be False.
      
      * change name by code review
      
      * format
      91298884
  4. 19 8月, 2022 1 次提交
  5. 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
  6. 08 7月, 2022 1 次提交
  7. 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
  8. 05 7月, 2022 1 次提交
  9. 01 7月, 2022 1 次提交
  10. 30 6月, 2022 1 次提交
  11. 28 6月, 2022 1 次提交
  12. 23 6月, 2022 1 次提交
  13. 13 6月, 2022 1 次提交
  14. 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
  15. 27 5月, 2022 1 次提交
  16. 09 3月, 2022 1 次提交
  17. 24 1月, 2022 1 次提交
  18. 10 12月, 2021 1 次提交
  19. 19 11月, 2021 1 次提交
  20. 03 11月, 2021 1 次提交
    • 0
      [Dy2stat]support Python3 type annotation (#36544) · db8425ec
      0x45f 提交于
      * Support Py3 type annotations in @to_static
      
      * support type hint for args in func
      
      * support type hint assign
      
      * if annotation and value(Constant) are diffent type, we use value type
      
      * polish type_from_annotation()
      
      * code format
      
      * code format
      
      * remove useless commentary
      
      * fix review
      Co-authored-by: NAurelius84 <zhangliujie@baidu.com>
      db8425ec
  21. 05 8月, 2021 1 次提交
  22. 24 6月, 2021 1 次提交
  23. 21 6月, 2021 1 次提交
  24. 17 6月, 2021 1 次提交
  25. 09 4月, 2021 1 次提交
  26. 24 3月, 2021 1 次提交
  27. 04 3月, 2021 1 次提交
  28. 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
  29. 20 1月, 2021 1 次提交
  30. 14 1月, 2021 1 次提交
  31. 18 12月, 2020 2 次提交
  32. 14 12月, 2020 1 次提交
    • L
      [Dy2Stat] 1. Fix bug of for-range stmts. 2. Support that step value is... · 0cad1152
      liym27 提交于
      [Dy2Stat] 1. Fix bug of for-range stmts. 2. Support that step value is negative in for-range stmts (#29519)
      
      1. Fix error in _build_cond_stmt of for-range stmts. 
      
      2. Support that step value is negative in for-range stmts
      
      3. Fix code because of the diff between Py2 and Py3
      0cad1152
  33. 04 12月, 2020 1 次提交
  34. 30 11月, 2020 1 次提交
    • W
      save model after jit.load (#28748) · 1476e1f9
      WeiXin 提交于
      * Changed a variable name error
      
      * Add comments
      
      * Move member functions of TranslatedLayer out of function
      
      * edit code according to review
      
      * Edit input argument of '_run_static_graph'
      
      * reset due to Segmentation fault
      
      * rename variables when stitching graph
      
      * modify code according CI
      
      * Add comments to '__i_m_p_l__'
      
      * remove blanks befor 'Get...'
      
      * edit code according to review
      
      * Add a comment to '_execution_method_creator'
      
      * Edit a comment to '_execution_method_creator'
      1476e1f9
  35. 19 11月, 2020 1 次提交
  36. 26 10月, 2020 1 次提交
  37. 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
  38. 02 9月, 2020 1 次提交
  39. 31 8月, 2020 1 次提交