"examples/vision/python_nfnet/ort_comparison.py" did not exist on "764b1e44d2415bdfa29e0010c324e6b44cac43c4"
Commit b726fc1a authored by Paul's avatar Paul
Browse files

Formatting

parent 058470c8
......@@ -88,8 +88,7 @@ struct argument_parser
static auto write_action(F f)
{
return [=](auto& x, auto& arg) {
arg.action = [&, f](auto& self, const std::vector<std::string>& params)
{
arg.action = [&, f](auto& self, const std::vector<std::string>& params) {
f(self, x, params);
return false;
};
......@@ -100,8 +99,7 @@ struct argument_parser
static auto do_action(F f)
{
return [=](auto&, auto& arg) {
arg.action = [&, f](auto& self, const std::vector<std::string>&)
{
arg.action = [&, f](auto& self, const std::vector<std::string>&) {
f(self);
return true;
};
......@@ -138,7 +136,7 @@ struct argument_parser
std::cout << " " << arg.help << std::endl;
}
std::cout << std::endl;
if (not msg.empty())
if(not msg.empty())
std::cout << msg << std::endl;
});
}
......@@ -153,8 +151,7 @@ struct argument_parser
{
return [=](auto& x, auto& arg) {
arg.type = "";
arg.action = [&, value](auto&, const std::vector<std::string>&)
{
arg.action = [&, value](auto&, const std::vector<std::string>&) {
x = value;
return false;
};
......
......@@ -19,7 +19,7 @@ inline auto& get_commands()
return m;
}
template<class T>
template <class T>
std::string command_name()
{
static const std::string& name = get_type_name<T>();
......@@ -29,7 +29,7 @@ std::string command_name()
template <class T>
int auto_register_command()
{
auto& m = get_commands();
auto& m = get_commands();
m[command_name<T>()] = [](std::vector<std::string> args) {
T x;
argument_parser ap;
......
......@@ -6,7 +6,7 @@ struct main_command
static std::string get_command_help()
{
std::string result = "Commands:\n";
for(const auto& p:migraphx::driver::get_commands())
for(const auto& p : migraphx::driver::get_commands())
result += " " + p.first + "\n";
return result;
}
......@@ -18,23 +18,24 @@ struct main_command
void run() {}
};
int main(int argc, const char* argv[]) {
int main(int argc, const char* argv[])
{
std::vector<std::string> args(argv + 1, argv + argc);
if (args.empty())
if(args.empty())
return 0;
auto&& m = migraphx::driver::get_commands();
auto cmd = args.front();
if (m.count(cmd) > 0)
if(m.count(cmd) > 0)
{
m.at(cmd)({args.begin()+1, args.end()});
m.at(cmd)({args.begin() + 1, args.end()});
}
else
else
{
migraphx::driver::argument_parser ap;
main_command mc;
mc.parse(ap);
ap.parse(args);
mc.run();
mc.run();
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment