mindspore.hal.set_cur_stream ============================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/hal/mindspore.hal.set_cur_stream.rst :alt: 查看源文件 .. py:function:: mindspore.hal.set_cur_stream(stream) 设置当前流,这是用于设置流的包装器API。 不建议使用此函数,建议使用 `StreamCtx` 上下文管理器。 参数: - **stream** (Stream) - 指定的流。如果是 ``None`` ,这个上下文管理器无操作。 异常: - **TypeError** - 参数 `stream` 即不是一个 :class:`mindspore.hal.Stream` 也不是一个 ``None``。