@ -21,8 +21,9 @@ import gast
import paddle . fluid as fluid
import paddle . fluid . dygraph as dygraph
from paddle . fluid . dygraph import to_variable
from paddle . fluid . dygraph . jit import dygraph_to_static_ graph
from paddle . fluid . dygraph . jit import dygraph_to_static_ func
from paddle . fluid . dygraph . dygraph_to_static . utils import is_dygraph_api
SEED = 2020
@ -62,7 +63,7 @@ class TestDygraphBasicApi_ToVariable(unittest.TestCase):
main_program = fluid . Program ( )
main_program . random_seed = SEED
with fluid . program_guard ( main_program ) :
static_out = dygraph_to_static_ graph ( self . dygraph_func ) ( self . input )
static_out = dygraph_to_static_ func ( self . dygraph_func ) ( self . input )
exe = fluid . Executor ( self . place )
static_res = exe . run ( main_program , fetch_list = static_out )
@ -205,7 +206,7 @@ class TestDygraphBasicApi(unittest.TestCase):
main_program . random_seed = SEED
with fluid . program_guard ( main_program , startup_program ) :
data = fluid . layers . assign ( self . input )
static_out = dygraph_to_static_ graph ( self . dygraph_func ) ( data )
static_out = dygraph_to_static_ func ( self . dygraph_func ) ( data )
exe = fluid . Executor ( fluid . CPUPlace ( ) )
exe . run ( startup_program )
@ -240,8 +241,8 @@ class TestDygraphBasicApi_BilinearTensorProduct(TestDygraphBasicApi):
main_program = fluid . Program ( )
main_program . random_seed = SEED
with fluid . program_guard ( main_program , startup_program ) :
static_out = dygraph_to_static_ graph ( self . dygraph_func ) ( self . input1 ,
self . input2 )
static_out = dygraph_to_static_ func ( self . dygraph_func ) ( self . input1 ,
self . input2 )
exe = fluid . Executor ( fluid . CPUPlace ( ) )
exe . run ( startup_program )
@ -367,7 +368,7 @@ class TestDygraphBasicApi_CosineDecay(unittest.TestCase):
main_program = fluid . Program ( )
main_program . random_seed = SEED
with fluid . program_guard ( main_program , startup_program ) :
static_out = dygraph_to_static_ graph ( self . dygraph_func ) ( )
static_out = dygraph_to_static_ func ( self . dygraph_func ) ( )
exe = fluid . Executor ( fluid . CPUPlace ( ) )
exe . run ( startup_program )