def test_saved_inner_graph():
 x = tensor.tensor3()
 recurrent = SimpleRecurrent(dim=3, activation=Tanh())
 y = recurrent.apply(x)
 application_call = get_application_call(y)
 assert application_call.inner_inputs
 assert application_call.inner_outputs
 cg = ComputationGraph(application_call.inner_outputs)
 assert (len(VariableFilter(applications=[recurrent.apply])(cg)) == 3)
 assert is_same_graph(application_call.inner_outputs[0], recurrent.apply(iterate=False, *application_call.inner_inputs))

def test_saved_inner_graph ( ) : x = tensor . tensor3 ( ) recurrent = SimpleRecurrent ( dim = 3 , activation = Tanh ( ) ) y = recurrent . apply ( x ) application_call = get_application_call ( y ) assert application_call . inner_inputs assert application_call . inner_outputs cg = ComputationGraph ( application_call . inner_outputs ) assert ( len ( VariableFilter ( applications = [ recurrent . apply ] ) ( cg ) ) == 3 ) assert is_same_graph ( application_call . inner_outputs [ 0 ] , recurrent . apply ( iterate = False , * application_call . inner_inputs ) )
make sure that the original inner graph is saved .