set_stream

paddle.device. set_stream ( stream ) [source]

Set the current stream.

Parameters

stream (Stream) – The selected stream.

Returns

The previous stream.

Return type

Stream

Examples

>>> 
>>> import paddle

>>> paddle.set_device('custom_cpu')
>>> s = paddle.device.Stream()
>>> paddle.device.set_stream(s)