pytorch / 2 / generated / torch.cpu.stream.html

torch.cpu.stream

torch.cpu.stream(stream) [source]

Wrapper around the Context-manager StreamContext that selects a given stream.

N.B. This function only exists to facilitate device-agnostic code

Return type

AbstractContextManager

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