1#ifndef XPED_MODELS_HELPERS_HPP_
2#define XPED_MODELS_HELPERS_HPP_
12std::string
format_params(
const std::string& name,
const std::map<std::string, Param>& params,
const std::vector<std::string>& used_params)
15 for(
const auto& p : used_params) {
16 if(p != used_params.back()) {
17 fmt::format_to(std::back_inserter(inner),
"{}={:.2f}, ", p, params.at(p).get<
double>());
19 fmt::format_to(std::back_inserter(inner),
"{}={:.2f}", p, params.at(p).get<
double>());
22 std::string res = fmt::format(
"{}({})", name, inner);
26std::string
create_filename(
const std::string& name,
const std::map<std::string, Param>& params,
const std::vector<std::string>& used_params)
28 std::string res = name +
"_";
29 for(
const auto& p : used_params) {
30 if(p != used_params.back()) {
31 fmt::format_to(std::back_inserter(res),
"{}={:.2f}_", p, params.at(p).get<
double>());
33 fmt::format_to(std::back_inserter(res),
"{}={:.2f}", p, params.at(p).get<
double>());
Definition: reverse_pass_callback_alloc.hpp:8
std::string format_params(const std::string &name, const std::map< std::string, Param > ¶ms, const std::vector< std::string > &used_params)
Definition: Helpers.hpp:12
std::string create_filename(const std::string &name, const std::map< std::string, Param > ¶ms, const std::vector< std::string > &used_params)
Definition: Helpers.hpp:26