CUDAGraph¶
- class torch.cuda.CUDAGraph[source]¶
Wrapper around a CUDA graph.
Warning
This API is in beta and may change in future releases.
- capture_begin(pool=None)[source]¶
Begins capturing CUDA work on the current stream.
Typically, you shouldn’t call
capture_beginyourself. Usegraphormake_graphed_callables(), which callcapture_begininternally.- Parameters:
pool (optional) – Token (returned by
graph_pool_handle()orother_Graph_instance.pool()) that hints this graph may share memory with the indicated pool. See Graph memory management.
- capture_end()[source]¶
Ends CUDA graph capture on the current stream. After
capture_end,replaymay be called on this instance.Typically, you shouldn’t call
capture_endyourself. Usegraphormake_graphed_callables(), which callcapture_endinternally.