Miscellaneous¶
-
double metatomic_torch::unit_conversion_factor(const std::string &quantity, const std::string &from_unit, const std::string &to_unit)¶
Get the multiplicative conversion factor to use to convert from unit
fromto unitto. Both should be units for the given physicalquantity.
-
torch::DeviceType metatomic_torch::pick_device(std::vector<std::string> model_devices, torch::optional<std::string> desired_device = torch::nullopt)¶
Select the best device according to the list of
model_devicesfrom a model, the user-provideddesired_deviceand what’s available on the current machine.This function returns a c10::DeviceType (torch::DeviceType). It does NOT decide a device index — callers that need a full torch::Device should construct one from the returned DeviceType (and choose an index explicitly). Or let it default away to zero via Device(DeviceType)
-
std::string metatomic_torch::pick_output(std::string requested_output, torch::Dict<std::string, ModelOutput> outputs, torch::optional<std::string> desired_variant = torch::nullopt)¶
Pick the output for the given
requested_outputfrom the availabilities of the model’soutputs, according to the optionaldesired_variant.