torch.accelerator.current_stream
-
torch.accelerator.current_stream(device=None, /)[source][source]
返回给定设备的当前流。
- 参数:
设备( torch.device
,str,int,可选)- 必须匹配当前加速器设备类型的给定设备。如果未提供,则默认使用 torch.accelerator.current_device_index()
。
- 返回值:
给定设备的当前选定流。
- 返回类型:
torch.Stream