def devices_to_string(devices):
    """
    Format device list to string

    :param devices: list of devices
    :type devices: int or str or list
    :return: string of device list
    :rtype: str
    """
    if isinstance(devices, str):
        return devices
    if isinstance(devices, int):
        devices = [devices]
    return ', '.join(['cuda:{}'.format(d) for d in devices])