(device_type)
| 37 | |
| 38 | |
| 39 | def _as_device_str_or_none(device_type): |
| 40 | # For backwards compatibility only, we support lowercase variants of |
| 41 | # cpu and gpu but turn them into uppercase here. |
| 42 | if device_type in ("cpu", "gpu"): |
| 43 | return device_type.upper() |
| 44 | return _as_str_or_none(device_type) |
| 45 | |
| 46 | |
| 47 | @tf_export("DeviceSpec", v1=[]) |
no test coverage detected