cuda_places¶
- paddle.static. cuda_places ( device_ids=None ) [source]
- 
         Note For multi-card tasks, please use FLAGS_selected_gpus environment variable to set the visible GPU device. The next version will fix the problem with CUDA_VISIBLE_DEVICES environment variable. This function creates a list of paddle.CUDAPlaceobjects.If device_idsis None, environment variable ofFLAGS_selected_gpuswould be checked first. For example, ifFLAGS_selected_gpus=0,1,2, the returned list would be [paddle.CUDAPlace(0), paddle.CUDAPlace(1), paddle.CUDAPlace(2)]. IfFLAGS_selected_gpusis not set, all visible gpu places would be returned according to theCUDA_VISIBLE_DEVICESenvironment variable.If device_idsis not None, it should be the device ids of GPUs. For example, ifdevice_ids=[0,1,2], the returned list would be [paddle.CUDAPlace(0), paddle.CUDAPlace(1), paddle.CUDAPlace(2)].- Parameters
- 
           device_ids (list|tuple, optional) – A list/tuple of int of GPU device ids. 
- Returns
- 
           Created GPU place list. 
- Return type
- 
           list of paddle.CUDAPlace 
 Examples import paddle import paddle.static as static # required: gpu paddle.enable_static() cuda_places = static.cuda_places() 
