(inp)
| 57 | |
| 58 | |
| 59 | def _valid_device(inp): |
| 60 | if isinstance(inp, str) and re.match( |
| 61 | "^([cxg]pu|rocm|multithread|cambricon)(x|\d+)(:\d+)?$", inp |
| 62 | ): |
| 63 | return True |
| 64 | return False |
| 65 | |
| 66 | |
| 67 | def _str2device_type(type_str: str, allow_unspec: bool = True): |
no test coverage detected