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