static torch::optional<std::string> normalize_variant(std::string variant_string)
{
if (variant_string == "no" || variant_string.empty())
{
return torch::nullopt;
}
else
{
return variant_string;
}
}
There's a version of this in LAMMPS, and now in GROMACS, perhaps it could just be moved into pick_output? ie.. https://docs.metatensor.org/metatomic/latest/torch/reference/cxx/misc.html#_CPPv4N15metatomic_torch11pick_outputENSt6stringEN5torch4DictINSt6stringE11ModelOutputEEN5torch8optionalINSt6stringEEE