Created by: Aurelius84
As the title.
Example code:
Class SubNet(fluid.dygraph.Layer):
@dygraph_to_static_graph
def forward(self, x)
return self.fc(x)
Class SubNet(fluid.dygraph.Layer):
def __init__(self):
self.fc_net = SubNet()
@dygraph_to_static_graph
def forward(self, x)
# Convert into static_func at first time
fc_1 = self.fc_net(x)
# Convert into static_func repeatly before this PR.
# In this PR, here cached static_func will be used.
fc_2 = self.fc_net(x)