W3cubDocs

/PyTorch 2.9

torch.xpu.set_stream

torch.xpu.set_stream(stream) [source]
Set the current stream.This is a wrapper API to set the stream.

Usage of this function is discouraged in favor of the stream context manager.

Parameters

stream (Stream) – selected stream. This function is a no-op if this argument is None.

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.xpu.set_stream.html