MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / parse_device

Function parse_device

src/python/lfs/py_tensor.cpp:1412–1418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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")

Callers 10

zerosMethod · 0.85
onesMethod · 0.85
fullMethod · 0.85
arangeMethod · 0.85
linspaceMethod · 0.85
eyeMethod · 0.85
randMethod · 0.85
randnMethod · 0.85
emptyMethod · 0.85
randintMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected