r"""Gets number of devices installed on this system. Args: device_type: device type, one of 'gpu' or 'cpu'
(device_type: str)
| 87 | |
| 88 | |
| 89 | def get_device_count(device_type: str) -> int: |
| 90 | r"""Gets number of devices installed on this system. |
| 91 | |
| 92 | Args: |
| 93 | device_type: device type, one of 'gpu' or 'cpu' |
| 94 | """ |
| 95 | assert device_type in _device_type_set, "device must be one of {}".format( |
| 96 | _device_type_set |
| 97 | ) |
| 98 | device_type = _str2device_type(device_type) |
| 99 | return CompNode._get_device_count(device_type, False) |
| 100 | |
| 101 | |
| 102 | def is_cuda_available() -> bool: |