albanD:

The Function that were used during the forward pass are not saved (because they are not needed for the backward pass) so only their corresponding backwards are saved.


ok, i got your point, thanks!  so if i want to draw the graph according to the forward, is there any method in recursion?  i can’t find any iterator in model before given datas like ‘next_functions’ in grad_fn.