Return logical devices.
(self, device_type=None)
| 1138 | self.set_visible_devices(visible_gpus, "GPU") |
| 1139 | |
| 1140 | def list_logical_devices(self, device_type=None): |
| 1141 | """Return logical devices.""" |
| 1142 | self.ensure_initialized() |
| 1143 | |
| 1144 | devices = [] |
| 1145 | for dev in self._logical_devices: |
| 1146 | if device_type is not None and device_type != dev.device_type: |
| 1147 | continue |
| 1148 | |
| 1149 | devices.append(dev) |
| 1150 | |
| 1151 | return devices |
| 1152 | |
| 1153 | def get_visible_devices(self, device_type=None): |
| 1154 | """Get the list of visible devices.""" |