评价此页

torch.accelerator.current_stream#

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

Return the currently selected stream for a given device.

参数

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.

返回

the currently selected stream for a given device.

返回类型

torch.Stream