torch.cuda.is_current_stream_capturing

torch.cuda.is_current_stream_capturing() [source]

Returns True if CUDA graph capture is underway on the current CUDA stream, False otherwise.

If a CUDA context does not exist on the current device, returns False without initializing the context.

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.cuda.is_current_stream_capturing.html