ReturnTransformer

class paddle.fluid.dygraph.dygraph_to_static.return_transformer. ReturnTransformer ( wrapper_root ) [source]

Transforms return statements into equivalent python statements containing only one return statement at last. The basics idea is using a return value variable to store the early return statements and boolean states with if-else to skip the statements after the return.

Go through all the function definition and call SingleReturnTransformer for each function. SingleReturnTransformer don’t care the nested function def.

generic_visit ( node )

generic_visit

Called if no explicit visitor function exists for a node.

visit ( node )

visit

Visit a node.