mindspore.hal.set_cur_stream

View Source On Gitee
mindspore.hal.set_cur_stream(stream)[source]

Set the current stream, this api will be deprecated and removed in future versions, please use the api mindspore.runtime.set_cur_stream() instead.

Parameters

stream (Stream) – selected stream. This function is a no-op if this argument is None.

Examples

>>> import mindspore
>>> cur_stream = mindspore.hal.current_stream()
>>> assert cur_stream == mindspore.hal.default_stream()
>>> s1 = mindspore.hal.Stream()
>>> mindspore.hal.set_cur_stream(s1)
>>> assert mindspore.hal.current_stream() == s1
>>> mindspore.hal.set_cur_stream(mindspore.hal.default_stream())