Rate this Page

torch.accelerator.current_stream#

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

Return the currently selected stream for a given device.

Parameters:

device (torch.device, str, int, optional) – a given device that must match the current accelerator 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