You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Paddle/python/paddle/v2/fluid/layers/device.py

23 lines
531 B

"""
All util layers.
"""
from ..layer_helper import LayerHelper
from ..framework import unique_name
__all__ = ['get_places']
def get_places(device_count=0, device_type="CPU"):
helper = LayerHelper('get_places', **locals())
out_places = helper.create_variable(name=unique_name(helper.name + ".out"))
helper.append_op(
type='get_places',
outputs={"Out": [out_places]},
attrs={
"device_type": device_type,
'device_count': device_count,
})
return out_places