torch.cuda.export_graph_data#
- torch.cuda.export_graph_data(path)[source]#
Return a post-instantiate hook that pickles
CUDAGraph.get_graph_data()topath. Register it withCUDAGraph.register_post_instantiate_hook():get_graph_dataneeds the graph instantiated (it remaps node ids to the exec graph id), and at post-instantiate time the template is still live, so this works for bothkeep_graphmodes.