Shortcuts

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_idx() by default.

Returns

the currently selected stream for a given device.

Return type

torch.Stream

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources