Resolves the device parameter of a learner.
"auto" becomes "cuda" when a CUDA device is available and "cpu" otherwise; any other value
is returned unchanged, except that an explicit "cuda" (or "cuda:<index>") without an available
CUDA device with that index is an error rather than a failure deep inside libtorch later on.