Leo Chen
488b2387e2
Feature/expand params in auto-generated pybind functions for dygraph operators ( #23181 )
...
* expand parameters, test=develop
* support resnet, test=develop
* fix resnet, test=develop
* support duplicable out, test=develop
* support ptb
* fix bugs, test=develop
* support null input, test=develop
* fix bugs, test=develop
* fix batchNorm is_test, test=develop
* refine code, test=develop
* follow comments, test=develop
* follow comments, test=develop
* follow comments, test=develop
* follow comments, test=develop
5 years ago
Aurelius84
9474d140de
Support Parameter type determination in StaticAnalysis ( #23302 )
...
* Support Parameter type determination test=develop
5 years ago
zhongpu
dc24f38a9f
support math operator for variable ( #23063 )
...
* support math operator for variable, test=develop
* polish code, test=develop
* polish code, test=develop
5 years ago
Aurelius84
f8205ffa82
fix conflict var bug in loop_transformer test=develop ( #23287 )
5 years ago
Aurelius84
16e74f1185
fix is_controw_flow bug with `if Tensor.numpy()` ( #23251 )
5 years ago
Zeng Jinle
8bfd62ffb7
Expose dygraph.grad api ( #23124 )
...
* expose dygraph.grad api, test=develop, test=document_fix
* add more parameter in dygraph.grad API, test=develop
* add only_inputs=True parameter, test=develop
* follow comments, test=develop, test=document_fix
* fix typo, test=develop, test=document_fix
5 years ago
Huihuang Zheng
e5af90aa28
Add Decorator 'dygraph_to_static_program' and ProgramTranslator.save_inference_model ( #23227 )
...
1. Add Decorator 'dygraph_to_static_program'
2. Add corresponding ProgramTranslator.get_program
3. Add ProgramTranslator.save_inference_model
4. Modified some warning information of dy2stat
5. Change program cache to contain startup_program because for users who gets program to run, they may like to initialize startup program
5 years ago
Aurelius84
a647bcd355
Add convert_function_with_cache in dygraph_to_static_func ( #23190 )
...
* add unittest test=develop
* add function cache test=develop
5 years ago
Aurelius84
d6f72c4fcc
Add parameter(learning_rate) in NoamDecay ( #23156 )
...
* Add parameter(learning_rate) in NoamDecay test=develop
5 years ago
liym27
af92630666
fix bug of loop_vars in loop_transformer.test=develop ( #23180 )
5 years ago
liym27
ebe4eab985
fix bug of ListTransformer in dygraph_to_static. test=develop ( #23153 )
5 years ago
Huihuang Zheng
e9b18c7402
Rename Decorator "dygraph_to_static_graph" to "dygraph_to_static_func" ( #23150 )
...
This PR does exact the thing as the title. The reason is that we plan to develop 4 decorators
"dygraph_to_static_code"
"dygraph_to_static_program"
"dygraph_to_static_func"
"dygraph_to_static_output"
The 4 decorators will emphasize different part when translating dygraph to static graph. Decorator name "dygraph_to_static_graph" is too big for the function it implements.
5 years ago
Huihuang Zheng
05c00af5f1
Add dygraph_to_static_code and get_code in ProgramTranslator ( #23162 )
...
As the title, we add decorator "dygraph_to_static_code", and add related "get_code", "get_func", "get_output" for ProgramTranslator. Next step will be adding "dygraph_to_static_program"
5 years ago
songyouwei
2787041246
bug fix ( #23193 )
...
test=develop
5 years ago
liym27
11f94cdce9
Improve function is_control_flow_to_transform. test=develop ( #23109 )
5 years ago
liym27
573d2faacd
fix bug in function `is_to_variable`. test=develop ( #23147 )
5 years ago
Huihuang Zheng
6fc6bb3e78
Refactoring Program Cache Related Code ( #23118 )
...
1. Rename AutoTracer to ProgramTranslator
2. Rename cached_program to program_cache
3. Remove some functor style __call__
4. Dict key should be string but not hash code of string
5 years ago
Zeng Jinle
a31d7328b7
Add dygraph double grad implementation ( #22939 )
...
* add double grad implementation for dygraph, test=develop
* polish code, add uts, test=develop
* fix place bug, test=develop
* polish codes, add more uts for coverages, test=develop
* add no_grad_set, test=develop
* add star gan ut, test=develop
* follow comments, test=develop
5 years ago
Huihuang Zheng
d066d6f994
[Dy2Stat] Change layers.data to fluid.data and Test Var Created In Loop ( #23103 )
...
As the title
5 years ago
songyouwei
2e2da7124b
high-performance dygraph slice ( #22879 )
...
* move __getitem__ to cpp
* bug fix
* add type check and gil release
* support negative step with omitted ends
test=develop
* code refine
test=develop
* bug fix
test=develop
* slice always return different pyobj
test=develop
5 years ago
Aurelius84
26bc953b3f
Fix returned arguments in IfElse_fn test=develop ( #23102 )
5 years ago
Aurelius84
31fc3ab79a
Support to use external function ( #23057 )
...
* Support to use external function test=develop
* refine the parms of ast_to_func test=develop
5 years ago
Huihuang Zheng
fb7b008acc
Add Support for Break and Continue in Dygraph to Static ( #23067 )
...
1. Add support for Break and Continue in Dygraph to Static
2. Also add support for gast.Not in NodeTestTransformer
3. Also add support for logical op transformation in LoopTransformer
5 years ago
liym27
5a202af90b
Support slice write in dygraph_to_static. test=develop ( #23055 )
5 years ago
Aurelius84
2403362d06
BugFix for parsing Arguments and inserting funcs in IfElseTransormer ( #23035 )
...
* Support and/or in controlFlow if test=develop
5 years ago
liym27
4af491c2bb
Tensor.shape support control flow if/for/while and bugfix ( #22866 )
...
* Support Tensor.shape in control flow if/for/while and separate TensorShapeTransformer from BasicApiTransformer. test=develop
5 years ago
Aurelius84
ab473357a2
Support and/or in dygraph_to_static control_flow_if ( #22967 )
...
* Support and/or in controlFlow if test=develop
* Refine IsControlFlow interface test=develop
5 years ago
Chen Weihang
3dfaf44adc
Rename dygraph parallel env & add doc ( #22925 )
...
* add dygraph parallel env doc, test=develop
* polish details, test=develop, test=document_fix
* fix examples error in other apis, test=develop
* fix more example error in other api, test=develop
* add white list for gpu examples, test=develop, test=document_fix
5 years ago
liym27
08e80d170b
Support list in control flow for dygraph_to_static ( #22902 )
...
* support list in control flow if. test=develop
* support list in for/while and supplement tests. test=develop
5 years ago
Huihuang Zheng
d7a7c5f0bf
Support Simple For Range Loop in Dygraph to Static ( #22867 )
...
1. Add basic support for `for in range` loop
2. Move `test_dygraph_to_static_*` to `dygraph_to_static` dir and rename them
3. Add test case for dict in while_loop
5 years ago
Aurelius84
4ff2915d1f
Refine code of IfElseTransformer and rename unittest files ( #22930 )
...
+ Refine code structure and move code related with control flow `if` into `ifelse_transformer.py`
+ Merge code of `ast_utils.py` into `utils.py`
5 years ago
Aurelius84
ba65e4ebef
support Tensor.shape in control_flow_if test=develop ( #22916 )
5 years ago
Zeng Jinle
d33c4343e1
Imperative tracer refactoring ( #22457 )
...
* refine grad maker, test=develop
* refactor tracer stage 1, test=develop
* merge develop to solve conflict third times, test=develop
5 years ago
liym27
b290420fc4
fix bug in the transformation from to_variable to assign. test=develop ( #22885 )
5 years ago
liym27
4ea95b6fe5
Support Tensor.shape in dygraph_to_static ( #22830 )
...
* support basic tensor.shape.
* Support tensor.shape with dependencies.
5 years ago
Huihuang Zheng
0d463d3bf7
Fix NameVisitor bugs ( #22847 )
...
1. copy.deepcopy in NameVisitor should be changed to copy.copy to make hash or set work
2. read_context should be type of gast.Load()/gast.AugLoad(), not gast.Load/gast.AugLoad
5 years ago
Huihuang Zheng
aca3f5311d
Support "while" in Dygraph to Static ( #22841 )
...
Add basic support for while in translating dygraph to static
1. Analysis the variable liveness in class NameVisitor
2. Replace while key word using while_loop API
5 years ago
Aurelius84
1217a52155
Modify the way of inserting newly defined func_nodes ( #22837 )
...
* Modify the way of inserting newly defined func_nodes test=develop
5 years ago
Aurelius84
a5036775a9
Add program_cache in dygrapht_to_static ( #22766 )
5 years ago
songyouwei
df87e79f54
Add functional dygraph mode api ( #22745 )
...
* functional dygraph enable/disable
test=develop
* use context manager instead
test=develop
* refine sample code
test=develop
* rename api & expose to fluid
test=develop
* fix sample code
test=develop
5 years ago
liym27
68a92e4674
fix dygraph_to_static_ouput and add a new decorator. ( #22785 )
...
* change dygraph_to_static_output to dygraph_to_static_graph. test=develop
* Remove duplicate code. test=develop
* Follow comments from Liujie. test=develop
* change dygraph_to_static_output to dygraph_to_static_graph. test=develop
5 years ago
liym27
8c381cd957
support fetch feed in dygraph to static graph ( #22767 )
...
* Support fetch and run program in the process of dygraph_to_static_output. test=develop
* fix to_source(gast) and remove dygraph API such as Conv2D, Linear. test=develop
5 years ago
Huihuang Zheng
66991218ec
Add Basic Function Return Type Analysis ( #22747 )
...
1. Considering functions, I have to change the node type from single value to a set. Because python function is allowed to return different types. The set represent all possible types
2. I added scope_name and scope_type for AstVarScope, because in python functions, variable may have different scope. For example:
```
a = 3
def foo(b):
a = 9
return a + b
```
the `a` in `foo` is different to the `a` out of `foo`. Similar to class field. The scope_name will help me to know the function name when static analysis finds a `return` sentence.
5 years ago
Aurelius84
dab5e5d8bc
Add IsControlFlowIfVisitor in ast_transformer ( #22709 )
...
* add is_control_flow_if test=develop
5 years ago
liym27
68c76793ca
support dygraph basic api transformed to static api ( #22678 )
...
* support dygraph to static graph for simple case.
* add test for dygraph API recognition. test=develop
* support basic to_variable api. test=develop
* update dict: dygraph_class_to_static_api
* add all tests of dygraph api. test=develop
* use gast/astor instead of ast/codegen for the compatibility of PY2 and PY3. test=develop
* add arg 'num_flatten_dims' for fc ast node. test=develop
* Modify names of class by Camel-Case.
5 years ago
tianshuo78520a
d2ba91aad1
fix typo words ( #22653 )
5 years ago
Leo Chen
d39d8bee4e
unexpose tracer, test=develop ( #22661 )
5 years ago
Aurelius84
08b09f6447
Support if/else in dygraph_to_static ( #22540 )
...
* support nested if/else
* support to derivate returns the parameter list automatically
* polish tranform function of slice
* fix modify x.numpy()[i] slice function
* support to transform ast.node into callable function
* fix get_name_ids bug and add more unittest test=develop
* fix requirements.txt test=develop
* remove useless import statement test=develop
* Fixed version compatibility issues in param of function test=develop
* use decorater to test ast_to_func test=develop
* add textwrap.dedent for source_code test=develop
* polish code comment
* fix compatibility with python2 and python3 test=develop
* fix gast version error test=develop
* fix gast repo test=develop
* polish transfer_from_node_type code test=develop
* add nested_if_else unittest test=develop
* split IfElseTransformer test=develop
* specify gast version test=develop
* fix ast_to_func root type test=develop
5 years ago
Huihuang Zheng
14672a6364
Add Basic Node Var Type Analysis ( #22603 )
...
1. Move AstNodeWrapper, StaticAnalysisVisitor to a new python file: static_analysis.py
2. Add basic node var type analysis
5 years ago
songyouwei
0aee43005a
Linear use mul op ( #22662 )
...
* Linear use mul op
test=develop
* fix unittest
test=develop
5 years ago
Aurelius84
8b41e2b3d1
add gast to replace ast test=develop ( #22630 )
5 years ago
songyouwei
d9f0c9f51c
support set param with None value ( #22418 )
...
* support reset param with None value
* add unittest
test=develop
* update unittest
test=develop
5 years ago
songyouwei
b768708e5d
fix pickle load encoding between python 2 and 3 ( #22621 )
...
test=develop
5 years ago
songyouwei
cb4560b79d
python 2 and 3 compatible pickle ( #22555 )
...
test=develop
5 years ago
Huihuang Zheng
a8dd425aa3
Add Static Analysis to Construct AstNodeWrapper ( #22569 )
...
As the title
5 years ago
Zeng Jinle
08033c8634
fix traced layer with non persistable vars, test=develop ( #22552 )
5 years ago
Huihuang Zheng
903039a3c6
Add Simple Framework for Transforming Dygraph to Static Graph ( #22491 )
...
This PR provides very basic and simple framework for transforming Dygraph to Static Graph.
API names, final outputs are not determined yet. Feel free to modify or add class/function/type when you think the framework is not extendable for you.
5 years ago
songyouwei
39bdefd875
open depthwise_conv2d in dygraph ( #22373 )
...
test=develop
5 years ago
songyouwei
99f5907e02
Fix layer & dygraph circular dependent ( #22334 )
...
* fix circular dependent
* try import layers.nn from dygraph
test=develop
5 years ago
songyouwei
4dec15999f
Allow Layer attr shadow ( #22333 )
...
* allow sublayer or param shadow attrs
* add unittest
test=develop
* change remove fn name
test=develop
5 years ago
hong
737334989b
State dict do not count data parallel layers ( #22169 )
...
* DataParallel state dict don't include _layers.; test=develop
* add unitest of data parallel; test=develop
* add load state test; test=develop
5 years ago
songyouwei
4bf2ccaa52
fix save_dygraph & save with nonexistent dir ( #22266 )
...
* fix save_dygraph with nonexistent dir
test=develop
* minor fix
test=develop
* fix unittest
test=develop
* fix static save
test=develop
5 years ago
songyouwei
83037e55ca
named_sublayers and named_parameters ( #21868 )
...
* use snake_cased Layer name
* add named_parameters and named_sublayers api
* add include_sublayers param, add unittest
test=develop
* fix named unittests
test=develop
* fix unittest
test=develop
* add api docs
test=develop
* arg fix
test=develop
* reserve rnn_impl name_scope for static graph
test=develop
* fix load static param
test=develop
* fix load static param
test=develop
5 years ago
zhongpu
7d10edc5ee
add clear_gradients for Optimizer and add clear_gradients api description ( #21948 )
...
* add clear_gradients for Optimizer, add api description, test=develop
* fix optest for optimizer's clear_gradient interface, test=develop
* add sample code, test=develop
* polish sample code, test=develop
5 years ago
Leo Chen
51cb918a05
update layers used in transformer dygraph model, test=develop ( #22051 )
...
* update layers, test=develop
* update layers for resnet, test=develop
* fix is_test attr, test=develop
* update cycle_gan, test=develop
* update reinforcement_learning, test=develop
* update ocr, test=develop
* fix bug, test=develop
5 years ago
songyouwei
1ae3f47f59
update PRelu arg ( #21946 )
...
* update PRelu arg
test=develop
* fix unittests
test=develop
* fix element mode alpha shape
test=develop
* split channel_or_input_shape arg
test=develop
* fix unittest
test=develop
5 years ago
zhongpu
cf475f95df
Remove FC in dygraph, modify FC to Linear in sample code ( #22082 )
...
* modify fc to linear in sample code, test=develop
* remove FC, test=develop
* remove warnings, test=develop
* drop fluid/imperative/README.md , test=develop
* change fc to linear, test=develop
* polish code style, test=develop
5 years ago
songyouwei
d0406193e3
LayerList add sublayer none check ( #22135 )
...
test=develop
5 years ago
hong
2f49cf70f7
Support dygraph structuerd name ( #21930 )
...
* support dygraph structured name; test=develop
* add load static param unitest and fix save load; test=develop
* fix varBase import error; test=develop
* fix unitest error; test=develop
* add comment for parameter; test=develop
* fix uni test error; test=develop
* change parallel se-resnet; test=develop
* fix dygraph se resnext parallel test; test=develop
* remove useless code; test=develop
* remove useless code; test=develop
5 years ago
songyouwei
2a47cc5fc4
dygraph LayerList container ( #21734 )
...
* add dygraph LayerList
* add unittest
test=develop
* add newline
test=develop
* typo fix
test=develop
5 years ago
songyouwei
56414c7daf
move private weight fields to public ones ( #21982 )
...
* move private weight properties to public ones
test=develop
* revert changes to FC
test=develop
* fix unittest
test=develop
* fix unittest
test=develop
* fix coverage
test=develop
* fix merged dev
test=develop
* bug fix
test=develop
5 years ago
Zeng Jinle
86c40e207d
Expose fluid.dygraph.TracedLayer API ( #21518 )
...
* expost fluid.dygraph.TracedLayer apis, test=develop
* polish doc, test=develop
* follow comments, test=develop, test=document_fix
* follow comments, test=develop
* remove save_inference_model return value, test=develop
5 years ago
Leo Chen
33f1306753
update layers used in mnist dygraph model, test=develop ( #21947 )
...
* update layers used in mnist dygraph model, test=develop
* fix import issue, test=develop
* add dygraph utils, test=develop
* add unittest, test=develop
5 years ago
Leo Chen
ba51043f7e
remove parameter block in to_variable, test=develop ( #21933 )
5 years ago
zhongpu
dca075839b
remove params in Tracer object (in dygraph) ( #20815 )
...
* remove params in Tracer object, test=develop
* Repair failed optest, test=develop
* remove build_once & name_scope (Conv2D)
test=develop
* fix unittest
test=develop
* Conv2DTranspose
* Conv3D & Conv3DTranspose
test=develop
* Pool2D & BatchNorm
* Embedding
* LayerNorm
* GRUUnit & NCE
* PRelu
* BilinearTensorProduct
* GroupNorm & SpectralNorm
* TreeConv
test=develop
* fix LayerNorm in transformer unnittest
test=develop
* disable LayerNorm or BatchNorm in multicard
test=develop
* refine Layer.create_parameter api
test=develop
* refine LayerNorm, remove begin_norm_axis param, add normed shape check
test=develop
* LayerNorm bug fix
test=develop
* fix optest,test=develop
* fix optest, test=develop
* fix optest for pass parameter_list when constructing an Optimizer class instance, test=develop
* polish code for better code style, test=develop
* fix se_resnext optest, test=develop
* polish code for better code style, test=develop
Co-authored-by: songyouwei <youwei0314@gmail.com>
5 years ago
songyouwei
cff7a49856
Add ParameterList ( #21056 )
...
* add ParameterList container
* add unittest
test=develop
* fix container, rebase remove build_once
test=develop
* add parameters None check
test=develop
* update Sequential unittest
test=develop
* use Linear in Sequential sample code
test=develop
* fix Sequential arg type doc
test=develop
5 years ago
Leo Chen
310edc0d0c
Update layers used in ptb model to use auto-generated op functions in dygraph mode ( #21724 )
...
* update layers, test=develop
* fix input numpy, test=develop
* fix bugs, test=develop
* follow commments, test=develop
* update getitem, test=develop
5 years ago
songyouwei
63a5fb4cac
tmp fix depthwise_conv2d in dygraph ( #21840 )
...
test=develop
5 years ago
songyouwei
1395828408
Add dygraph Linear layer ( #21265 )
...
* add Linear layer
test=develop
* update unittest for coverage
test=develop
5 years ago
Zeng Jinle
04909137f5
fix lr assert, test=develop ( #21780 )
5 years ago
Leo Chen
c96f06f2f6
add unary operator __neg__, test=develop ( #21787 )
...
adds unary operator __neg__ for VarBase in dygraph mode, and for Variable in static graph mode.
5 years ago
Youwei Song
f6144d8463
remove build_once & name_scope ( #21131 )
...
* remove build_once & name_scope (Conv2D)
test=develop
* fix unittest
test=develop
* Conv2DTranspose
* Conv3D & Conv3DTranspose
test=develop
* Pool2D & BatchNorm
* Embedding
* LayerNorm
* GRUUnit & NCE
* PRelu
* BilinearTensorProduct
* GroupNorm & SpectralNorm
* TreeConv
test=develop
* fix LayerNorm in transformer unnittest
test=develop
* disable LayerNorm or BatchNorm in multicard
test=develop
* refine Layer.create_parameter api
test=develop
* refine LayerNorm, remove begin_norm_axis param, add normed shape check
test=develop
* LayerNorm bug fix
test=develop
5 years ago
Leo Chen
9c481e12ba
Patch math method for VarBase using auto-generated op functions ( #21656 )
...
* patch math method for varbase using auto-generated op functions, test=develop
* clean code that handles batch_size, test=develop
* follow comments, test=develop
* follow comments, test=develop
* code clean, test=develop
5 years ago
zhongpu
8777e8c1e9
fix Conv2DTranspose API, test=develop ( #21403 )
5 years ago
Leo Chen
4f81d1bd5f
Refine VarBase init function ( #21587 )
...
* refine init function, test=develop
* add tests, test=develop
* remove extern, which may cause symbol error in gcc-4.8, test=develop
5 years ago
hong
08483a6819
Add dygraph linear warm up decay ( #21186 )
...
* dygraph mode support linear lr warm up; test=develop
* add unitest for linear warmup; test=develop
* add input type check; test=develop
* fix type check assert error; test=develop
* change type error; test=develop
5 years ago
Leo Chen
cdd46d7e02
Split VarBase from Python Variable for Dygraph ( #21359 )
...
* test=develop, fix docker with paddle nccl problem
* don't expose numerous Tensor.set(), test=develop
* fix condition, test=develop
* fix float16 bug, test=develop
* feed should be Tensor or np.array, not Variable or number, test=develop
* use forcecast to copy numpy slice to new array, test=develop
* remove float16-uint16 hacking, test=develop
* add variable method to varbase and refactor to_variable to support return varbase
* support kwargs in varbase constructor
* add VarBase constructor to support default python args
* refine varbase initial method
* reset branch
* fix ut for change VarBase error info to PaddleEnforce
* cherry is parameter change before
* overload isinstance to replace too many change of is_variable
* rm useless files
* rm useless code merged by git
* test=develop, fix some ut failed error
* test=develop, fix test_graph_wrapper
* add some tests, test=develop
* refine __getitem__, test=develop
* add tests, test=develop
* fix err_msg, test=develop
5 years ago
Youwei Song
cdba41af4d
dygraph Embedding layer use lookuptable v2 ( #21209 )
...
* dygraph Embedding layer use lookuptable v2
test=develop
* fix test_nce
test=develop
5 years ago
Chen Weihang
664f958a02
Fix optimizer op infershape failed in dygraph multi-cards mode ( #21374 )
...
* add param & grad shape check for sgd op
* add _reshape_inplece interface for dygraph parallel
* refine unittest based paddle/models scripts, test=develop
* add unittest for parallel grad fuse, test=develop
5 years ago
Youwei Song
d5ff79e55e
Support numpy bridge (enabled by default in dygraph mode) ( #20983 )
...
* add numpy bridge
* fix template compile
* add unittest, add default
test=develop
* fix unittest
test=develop
* fix unittest
test=develop
* zero_copy=True for to_variable,
test=develop
* bug fix
test=develop
* disable deprecated NumPy API
test=develop
* use better design of NumpyAllocator
test=develop
* fix Py_None check
test=develop
* reset c++ tracer when jump out dygraph guard
test=develop
* refine PADDLE_ENFORCE_xx format
test=develop
* bug fix of tracer switch
test=develop
* update decref
test=develop
5 years ago
Zeng Jinle
67e88424e5
Polish jit trace codes ( #21218 )
...
* polish jit trace codes, test=develop
* polish codes again by removing var_id, test=develop
5 years ago
Zeng Jinle
0f30d3a213
fix dygraph trace bug, test=develop ( #21193 )
5 years ago
Zeng Jinle
5fdfbe3413
Add friendly dygraph trace API ( #21091 )
...
* friendly trace interface, test=develop
* refine TracedLayer, test=develop
* add some docs, test=develop
5 years ago
Wojciech Uss
226bc22a29
Remove fuse_with_relu argument from batch_norm constructor ( #21028 )
...
test=develop
5 years ago
Leo Chen
008ed65fd5
Add c++ global current tracer for dygraph ( #20882 )
...
* Add c++ global current tracer for dygraph, test=develop
* add tracer property in c++, test=develop
* support different place, test=develop
* add unittest for tracer, test=develop
5 years ago
Leo Chen
9974e40787
Update Tensor.set() to support float16 ( #19964 )
...
* don't expose numerous Tensor.set(), test=develop
* fix condition, test=develop
* fix float16 bug, test=develop
* feed should be Tensor or np.array, not Variable or number, test=develop
* use forcecast to copy numpy slice to new array, test=develop
* remove float16-uint16 hacking, test=develop
5 years ago
Youwei Song
2058bab1c0
Add Sequential api ( #20789 )
...
* add Sequential api
test=develop
* fix unittest
test=develop
* refine code sample
* test=develop
5 years ago
Zeng Jinle
378fc4fb1c
add some docs to jit.trace, test=develop ( #20811 )
5 years ago
Zeng Jinle
8ff6b289bd
[Dygraph to static graph]JIT/Trace ( #20775 )
...
* jit/trace 1st version, test=develop
* add more unittests, test=develop
5 years ago
Youwei Song
9a09ff14a5
fix en docs of Layer and guard ( #20512 )
...
* fix en docs of Layer and guard
test=document_fix, test=develop
* fix en docs of Layer and guard
test=document_fix, test=develop
* minor fix
test=document_fix, test=develop
* minor fix
test=document_fix, test=develop
* fix api.spec
test=document_fix, test=develop
* fix api.spec
test=document_fix, test=develop
* fix docs
test=document_fix, test=develop
* fix docs
test=document_fix, test=develop
* fix docs
test=document_fix, test=develop
* fix api.spec
test=document_fix, test=develop
* fix api.spec
test=document_fix, test=develop
* add forward doc
test=document_fix, test=develop
* add "s" for parameters
test=document_fix, test=develop
5 years ago
LielinJiang
faa8e30a14
Set batch norm and data norm argument 'do_model_average_for_mean_and_var' default as True ( #20421 )
...
* fix_norm_model_average_bug
* test=develop
* refine comment test=develop
* refine comment test=develop
5 years ago
zhongpu
0b321c8a2f
fix APIs, to_variable、NCE、PRelu、softmax、rankloss for dygraph, test=document_fix, test=develop ( #20142 )
5 years ago
zhongpu
52dcc1679d
fix Embedding API for dygraph ( #20358 )
...
* fix Embedding API for dygraph, test=develop, test=document_fix
* fix dtype, test=develop, test=document_fix
5 years ago
DuYao
76a5819728
update English document ( #20330 )
...
* update English document, test=document_fix
* update api.spec, test=document_fix
* update api.spec, test=document_fix
* update, test=document_fix
5 years ago
zhongpu
95e5768bd6
update conv, fc, pool op for dygraph, test=develop ( #20132 )
5 years ago
zhongpu
9ca417f1d0
fix APIs, update norm op, test=develop ( #20119 )
...
* update norm op, test=develop, test=document_fix
* fix norm api, test=develop, test=document_fix
5 years ago
hong
fa43e80e19
New save load interface ( #20148 )
...
* add new save load interface; test=develop
* add new save interface; test=develop
* add save load interface ;
* fix save load error;
* fix dygraph set dict bug;
* add save load unit test; test=develop
* fix test_imperative_optimizer bug; test=develop
* fix unitest optimizer bug; test=develop
* fix code coverage; test=develop
* fix converage; test=develop
* add document for apis; test=develop
* fix unitest error; test=develop
* fix save load unit test error; test=develop
* fix error message; test=develop
* change set_parameter set_optimizer to save_dygraph; test=develop
* add load_graph check; test=develop
* fix api spec; test=develop
5 years ago
Youwei Song
54e07994ee
Dygraph Layer kwargs & param getter setter ( #19901 )
...
* opt FC
* opt rest of dygraph.nn
* new param shape check and unittest
* add kwargs for Layer
* add new set_value api
* use property decorator
* update API.spec, test=develop
* use UserList, separate gettersetters, test=develop
* update test_custom_layer_with_kwargs, test=develop
* fix UserList compatibility, test=develop
* fix UserList compatibility, test=develop
* keep FC._w, test=develop
* add unittests, Conv3D bug fix, test=develop
* clean code, test=develop
* fix dygraph guard in unittest, test=develop
* add property setters, remove unused param in tracer, test=develop
* tracer none check, test=develop
* merge, test=develop
* refine, test=develop
* bug fix in prelu and conv3d_transpose, test=develop
* rm __set__, test=develop
* set tensor value instead of assign op
* fix property setter call, test=develop
* fix api.spec, test=develop
* fix doc sample, test=develop
5 years ago
Jiabin Yang
39ff0f9cd9
Optimze/optimize dygraph api ( #19999 )
...
* test=develop, fix docker with paddle nccl problem
* test=develop, Add Variable api and refine dygraph related API
* test=develop, Add Variable api and refine dygraph related API
* test=develop, refine test for new api and error info
* test=develop, refine error info and test_layers
* test=develop, add API.spec
* test=devleop, fix to_string python2 and python3 compat error and refien doc
* test=devleop, add API spec
* test=devleop, update API spec
* test=devleop, update API spec
* test=develop, invoke ci
* test=develop, fix example code
* test=develop, update API spec
* test=develop, add compat test and fix inplace campat dict error
5 years ago
chengduo
b99fc38cec
Add fp16 support for dygraph ( #19828 )
...
* Add fp16 support for dygraph
test=develop
* Add unit test
test=develop
6 years ago
Youwei Song
3e5fb6361b
fix api-doc error for dygraph and backward ( #19721 )
...
* update dygraph api-doc and backward api-doc, test=develop
* update dygraph api-doc and backward api-doc, update api.spec, test=develop
* update dygraph api-doc and backward api-doc, update api.spec, test=develop
* update API.spec, test=develop
6 years ago
Chen Weihang
73daa3d6c0
Code Cleanup: delete three useless raw variables in Conv2D ( #19644 )
...
* delete useless raw variables in Conv2D, test=develop
* adjust the vars number in test_graph_wrapper to pass unittest, test=develop
6 years ago
Jiabin Yang
e9233d1c1e
Refactor dygraph ( #19107 )
...
* refactor dygraph,test=develop
* fix failed unittest,test=develop
* polish code,test=develop
* check windows ci error,test=develop
try to fix windows ci error by np.allclose,test=develop
* polish vlog and profiler, test=develop
* try to fix preceding ops order,test=develop
* test transformer in windows ci, test=develop
* use python c-api to speed up tracer.trace,test=develop
* test=develop, fix docker with paddle nccl problem
* test=develop, add ut for debug string and gradient_accumulator
* test=develop, add tests for layer/gradient_accumulator/prepared_op
* test=develop, fix complie error for test_prepared_op
* test=develop, add more ut for dygraph
* test=develop, create API.spec for dygraph api change
* test=develop, refoctor name to make it easier to understand
* test=develop, refoctor name to make it easier to understand
* test=develop, fix multi-gpu failed problem , add Tracer tests, change PADDLEENFORCE to PADDLEENFORCE_EQ
* test=develop, fix ut failed on parallel se-resnext
* test=develop, change one more PADDLE_ENFORCE
6 years ago
Youwei Song
9a577f2e41
fix batchnorm api param: data_layout ( #19524 )
...
* fix batchnorm api param: data_layout
* fix batchnorm data_layout param; test=develop
6 years ago
Jiabin Yang
1ce0a09e60
fix con2d transpose bias by create and init it in build_once ( #18968 )
...
* fix con2d transpose bias by create and init it in build_onee
* fix API spec
* test=develop, invoke ci
* fix bias_attr and act has no effect error on layer norm, conv2dTranpose, billinearTensorProduct, sequece_conv. fix original_mode not used error on GRUunit. fix sample_weight not set error on NCE. Add ut for all thoese layer
* test=develop, change success standard for conv2dTranspose
* test=develop, fix test_layers to invoke some error branch
* test=develop, fix sample code
* test=develop, fix BilinearTensorProduct failed in dygraph mode
* test=develop, fix test_layers segment fault error
6 years ago
Ghost Under Moon
10643b4ea6
fix- raise io error when user load from non-existed dir test=develop ( #19384 )
...
This PR fix problem with issue #18096 , which raise an error for user to specify the error about load dir is wrong
6 years ago
Jiabin Yang
55931db449
fix problem that get_attr method can't using default mode when we call has_attr in dygraph ( #19328 )
...
* add default getItem
* test=develop, fix has_attr disabled error in Layer
* test=develop, fix GroupNorm and deepcf bug on attrs
6 years ago
chengduo
5a579df9ba
[Speedup] Make dygraph data parallel faster ( #19280 )
...
* update parallel.py
test=develop
6 years ago
chengduo
20859c08e8
[DyGraph] Make multi-card program faster ( #18892 )
...
* update parallel.py
test=develop
6 years ago
lujun
b6d5c74f69
update dygraph api doc for web ( #18550 )
...
remove dygraph.enable from __all__
hidden dygraph. profiler
add doc to dygraph. no_grad
6 years ago
Jiabin Yang
7586cdd545
Hide no support ( #18515 )
...
* test=develop, fix docker with paddle nccl problem
* test=develop, hide no_support api and add ut for it
6 years ago
lujun
fd6631ef2f
Fix dygraph show style ( #18297 )
...
Fix dygraph show style for FluidDoc.
6 years ago
Zeng Jinle
25ab23be28
Fix dygraph mem leak ( #18082 )
...
* fix dygraph mem leak, test=develop
* polish msg, test=develop
6 years ago
lujun
dcaf60f06c
Fix dygraph doc at nn.py for v1.5 ( #17904 )
...
fix doc: conv3d, layer norm, bilineartensorproduct, conv2dtranspose, conv3dtranspose,rowconv, groupnorm, spectralnorm, treeconv
hidden api: sequenceConv
6 years ago
Hongyu Liu
2a9d74f67c
Add comment for dygraph api ( #17869 )
...
* add api commet; test=develop
* fix fc dtype bug; test=develop
* remove float32 in default parameter; test=develop
* fix exmpale bug; test=develop
* fix build once; test=develop
* fix num_chanels bug; test=develop
* fix install check failed bug; test=develop
6 years ago
Jiabin Yang
4d5f6937c3
Feature/refine api for dygraph ( #17907 )
...
* WIP
* WIP
* test=develop, add api doc and example code for dygraph
6 years ago
Jiabin Yang
fba10b6bb5
test=develop, refine api ( #17883 )
...
* test=develop, refine api
* test=develop, fix bug when error occured on save_persistable with no optimizer
* test=develop, refine waring
* test=develop, refine example code and comments
6 years ago
Jiabin Yang
4cb7d32c9b
test=develop, add dygraph_not_support and refine ocr ( #17868 )
...
* test=develop, add dygraph_not_support and refine ocr
* test=develop, shrink name of dygraph_not_support
6 years ago
xiaoting
545afb2d74
Add trainable_statist attr for bn in dygraph ( #17881 )
...
* add import, test=develop
* fix fill_constant
* fix deconv
* add trainable_statist for bn in dygraph
6 years ago
Jiabin Yang
3bfb92c32b
test=develop, hide build_once ( #17871 )
6 years ago
Jiabin Yang
022dfed4fc
Add optimizer save and load ( #16986 )
...
* save optimizer related vars in dygraph
* test=develop, add optimizer save and load
* test=develop, add optimizer save and load
* test=develop, merge code and add multi-optimizer save and load
* test=develop, fix test_imperative_checkpoint
* test=develop, fix include error
* test=develop, fix include error
* test=develop, renew api spec
* test=develop, refine code
* test=develop, set default value for checkpoint
* test=develop, fix ci error
* test=develop, change API.spec and make api more readable
* test=develop, refine version and time stamp
* test=develop, add example code and refine code
* test=develop, refine doc
* test=develop, change version
6 years ago
Zeng Jinle
674e0ce2d6
Use Python C-API to speed up dygraph trace ( #17837 )
...
* use python api to reduce python time cost, test=develop
* fix travis ci, test=develop
* fix Py_None error,test=develop
6 years ago
Jiabin Yang
3b70f870e2
Using Smart pointer to optimizer memory usage of dyGraph ( #17768 )
...
* for debug
* test=develop, memory optimize for dygraph using shared_ptr
* test=develop, fix travis ci showed error
* test=develop, fix bug for recurrent usage of varbase
* test=develop, init varbase when it need to be Add
6 years ago
Zeng Jinle
3a6ead24ad
Add no_grad decorator to dygraph ( #17790 )
...
* add no_grad decorator to dygraph, test=develop
* add unittest,test=develop
6 years ago
lujun
7f1c626921
Fix potential bugs: use numpy assignment to restore parameters at build-once, test=develop ( #17720 )
...
use numpy assignment to restore parameters at build-once
6 years ago
Hongyu Liu
aca53535e0
fix bug; test=develop ( #17733 )
6 years ago
Jiabin Yang
effc555955
test=develop, layz init Grad ( #17653 )
6 years ago
lujun
0f2e7a48c8
fix:Modify keys in the dictionary of layer.stat_dict in dynamic graph mode, test=develop ( #17700 )
6 years ago
chengduo
21d7b78602
update parallel_helper ( #17691 )
...
test=develop
6 years ago
Zeng Jinle
432ac70124
clean code of py_layer in dygraph mode,test=develop ( #17661 )
6 years ago
chengduo
b5f4d5ed0e
Add broadcast operators ( #17503 )
...
* This PR adds broadcast for multi-process. And it could be used in dynamic graph to broadcast parameters.
6 years ago
Jiabin Yang
ff5fdc0b67
test=develop, fix con2d with no bias ( #17516 )
...
* test=develop, fix con2d with no bias
* test=develop, fix conv_2d with no bias will have null shape
6 years ago
Jiabin Yang
d2682a84ca
test=develop, fix dygraph batch_norm ( #17465 )
6 years ago
Hongyu Liu
306eadcd39
fix eval mode bug; test=develop ( #17499 )
6 years ago
Yan Xu
0217555530
polish parallel dygraph code ( #17164 )
...
* add var grad hook test=develop
6 years ago
Zeng Jinle
eab34b2df6
fix_dygraph_mem_leak, test=develop ( #17396 )
6 years ago
Jiabin Yang
4624d7c642
test=develop, add gradient sort backward strategy ( #17125 )
...
* test=develop, add gradient sort backward strategy
* test=develop, fix test by add FLAGS_cudnn_deterministic on new tests
6 years ago
Jiabin Yang
d8af44a5a3
test=develop, fix error with training and test on diff device ( #17276 )
6 years ago
Zeng Jinle
5dfe2ab9e8
Fix mem leak when converting Tensor to numpy array ( #17182 )
...
* fix mem leak when converting Tensor to numpy array
test=develop
* remove unused unittest,test=develop
* follow comments, test=develop
* fix dygraph bug,test=develop
6 years ago
Yan Xu
0b07eef118
ParallelDyGraph with GPU collective mode ( #16827 )
...
implement dygraph.parallel.DataParallel to hook reduce op.
6 years ago
lujun
9d2f7d762c
fix dy-load bug, test=develop
6 years ago
lujun
94c4cd1a98
fix dy-load bug, test=develop
6 years ago
lujun
a3f17280a3
fix dy-load bug, test=develop
6 years ago
lujun
dbf66dd034
Merge pull request #16954 from junjun315/fix-dygraph-checkpoint
...
Fix dygraph checkpoint bug
6 years ago
lujun
a7c11979ba
fix dygraph save/load checkpoint error, test=develop
6 years ago
minqiyang
97aa1838bc
Fix dygraph train mode
...
test=develop
6 years ago
minqiyang
73cbdc2998
Add train mode
...
test=develop
6 years ago
minqiyang
734260f47b
Make Op Hold Output too and release backward_refs each time
...
test=develop
6 years ago
minqiyang
20e304f2ae
Tracer does not hold op any more
...
test=develop
6 years ago
lujun
92c8ac8a74
merge conflict, test=develop
6 years ago
minqiyang
2e0b871320
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into imperative_dqn
6 years ago
Yan Xu
b4c3a6aa0b
[Imperative] implement imperative NCCLParallelContext ( #16477 )
...
add NCCLParallelContext for parallel dygraph
6 years ago
lujun
01f4f2d7e4
merge confict, test=develop
6 years ago
minqiyang
61fe139f34
Polish code
6 years ago
lujun
e11bf2a49e
merge branch, test=develop
6 years ago
lujun
a32c6ffa96
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into move-api-to-root
6 years ago
minqiyang
e377d75977
Add UT for most layers without params
...
test=develop
6 years ago
lujun
ad7c1a934f
merge conficts, test=develop
6 years ago
lujun
60e3e35575
merge branch, test=develop
6 years ago
Jiabin Yang
353244f4fc
test=develop, add FC and test ( #16604 )
...
* test=develop, add FC and test
* test=develop, refine code
6 years ago
lujun
717256755a
move dygraph.nn,dygraph.layer to fluid, test=develop
6 years ago
lujun
cf6238fbd9
fix merge for move dir, fix utest error, test=develop
6 years ago
lujun
1dcd28e819
move dygraph.nn,dygraph.layer to fluid, test=develop
6 years ago
lujun
5470c29daa
fix merge for move dir, fix utest error, test=develop
6 years ago
minqiyang
fb7c787d34
Fix conflicts
...
test=develop
6 years ago
minqiyang
3e57981294
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into imperative_lr_scheduler
...
test=develop
6 years ago
lujun
d4d5052fa6
fix merge for move dir, fix utest error, test=develop
6 years ago
lujun
32146857a4
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into move-code
6 years ago
lujun
1c9aaeebe0
move imperative to dygraph, test=develop
6 years ago