| 1410 | |
| 1411 | namespace { |
| 1412 | Device parse_device(const std::string& device) { |
| 1413 | if (device == "cuda" || device == "gpu") |
| 1414 | return Device::CUDA; |
| 1415 | if (device == "cpu") |
| 1416 | return Device::CPU; |
| 1417 | throw std::runtime_error("Unknown device: " + device); |
| 1418 | } |
| 1419 | |
| 1420 | DataType parse_dtype(const std::string& dtype) { |
| 1421 | if (dtype == "float32" || dtype == "float") |