# tensorplay.cuda.graphs.graph

Source: https://www.tensorplay.cn/docs/generated/tensorplay.cuda.graphs.graph.html

# tensorplay.cuda.graphs.graph

tensorplay.cuda.graphs.graph(cuda_graph, pool=None, stream=None, capture_error_mode='global')[[source]](../_modules/tensorplay/cuda/graphs.html#graph)

Context-manager that captures CUDA work into a tensorplay.cuda.CUDAGraph.

Parameters:

- cuda_graph ([CUDAGraph](tensorplay.cuda.graphs.CUDAGraph.html#tensorplay.cuda.graphs.CUDAGraph)) – the graph object to capture into.

- pool – unsupported (each capture gets its own private memory pool).

- stream ([Stream](tensorplay.cuda.streams.Stream.html#tensorplay.cuda.streams.Stream) , optional ) – unsupported; capture always runs on the dedicated side stream exposed by the runtime.

- capture_error_mode ([str](https://docs.python.org/3/library/stdtypes.html#str) , optional ) – "global" (default) makes any unsafe CUDA call anywhere in the process fail the capture. "thread_local" and "relaxed" are rejected because the native binding always captures in global mode.
