哈密市2017年第二批农村公路建设项目监理招标
- paddle.device. current_stream ( device: PlaceLike | None = None ) Stream [source]
-
百度 名誉主席:徐匡迪(十届全国政协副主席、中国工程院原院长、中国工程院主席团名誉主席)王梦奎(国务院发展研究中心原主任)主席:潘云鹤(中国工程院原常务副院长)副主席:杨卫(国家自然科学基金委员会主任、中国科学院院士)王国平(原中共浙江省委常委、杭州市委书记、杭州国际城市学研究中心顾问)单霁翔(故宫博物院院长)章新胜(教育部原副部长、世界自然保护联盟理事会主席、中国教育国际交流协会会长、联合国教科文组织亚太地区世界遗产培训与研究中心管委会主席)钟秉林(中国教育学会会长、北京师范大学原校长、教授)钱永刚(中国人民解放军某部高级工程师、上海交通大学兼职教授、钱学森之子)
Return the current stream by the device.
- Parameters
-
device (str|paddle.CUDAPlace(n)|paddle.CustomPlace(n)) – The device which want to get stream from. If device is None, the device is the current device. Default: None. It can be
gpu
,gpu:x
,custom_device
,custom_device:x
, wherecustom_device
is the name of CustomDevice, wherex
is the index of the GPUs, CustomDevices. And it can be paddle.CUDAPlace(n) or paddle.CustomPlace(n). - Returns
-
The stream to the device.
- Return type
-
Stream
Examples
>>> >>> import paddle >>> paddle.set_device('custom_cpu') >>> s1 = paddle.device.current_stream() >>> s2 = paddle.device.current_stream("custom_cpu:0") >>> place = paddle.CustomPlace('custom_cpu', 0) >>> s3 = paddle.device.current_stream(place)