Dygraph to Static Graph

The imperative-style coding of PaddlePaddle takes advantage of flexibility, Pythonic coding, and easy-to-debug interface. In dygraph mode, code immediately executes kernels and gets numerical results, which allows users to enjoy traditional Pythonic code order. Therefore it is efficient to transform idea into real code and simple to debug. However, Python code is usually slower than C++ thus lots of industrial systems (such as large recommend system, mobile devices) prefer to deploy with C++ implementation.

Static graph is better at speed and portability. Static graph builds the network structure during compiling time and then does computation. The built network intermediate representation can be executed in C++ and gets rids of Python dependency.

While dygraph has usability and debug benefits and static graph yields performance and deployment advantage, we adds functionality to convert dygraph to static graph. Users use imperative mode to write dygraph code and PaddlePaddle will analyze the Python syntax and turn it into network structure of static graph mode. Our approach retains both the usability of dygraph and portability of static graph.

We introduce the transformation of dygraph to static graph in the following links:

System Message: WARNING/2 (/FluidDoc/docs/guides/04_dygraph_to_static/index_en.rst, line 24)

toctree contains reference to nonexisting document ‘guides/04_dygraph_to_static/export_model_en’

System Message: WARNING/2 (/FluidDoc/docs/guides/04_dygraph_to_static/index_en.rst, line 24)

toctree contains reference to nonexisting document ‘guides/04_dygraph_to_static/case_analysis_en’