torch.accelerator.current_stream — PyTorch 2.7 documentation (original) (raw)

Shortcuts

torch.accelerator.current_stream(device=None, /)[source][source]

Return the currently selected stream for a given device.

Parameters

device (torch.device, str, int, optional) – a given device that must match the currentaccelerator device type. If not given, use torch.accelerator.current_device_index() by default.

Returns

the currently selected stream for a given device.

Return type

torch.Stream

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.