Rate this Page
★ ★ ★ ★ ★

Stream#

class torch.mps.Stream(device=None, **kwargs)#

Wrapper around an MPS stream.

An MPS stream is a linear sequence of execution that is independent from other streams. Use the stream() context manager to ensure operators run on the corresponding stream.

Parameters:

device (torch.device or int, optional) – a device on which to allocate the stream. If device is None (default) or a negative integer, this will use the current device.

synchronize()[source]#

Wait for all the kernels in this stream to complete.