torch.accelerator.current_stream¶
- torch.accelerator.current_stream(device=None, /)[源代码][源代码]¶
返回给定设备的当前选定流。
- 参数
device (
torch.device
, str, int, optional) – 给定的设备,必须与当前的 加速器 设备类型匹配。如果未给定,则默认使用torch.accelerator.current_device_index()
。- 返回
给定设备的当前选定流。
- 返回类型