Commit 39cc651d authored by Khalique's avatar Khalique
Browse files

formatting

parent 03b861f1
...@@ -7,7 +7,7 @@ int main(int argc, char const* argv[]) ...@@ -7,7 +7,7 @@ int main(int argc, char const* argv[])
{ {
std::string file = argv[1]; std::string file = argv[1];
auto prog = migraphx::parse_onnx(file); auto prog = migraphx::parse_onnx(file);
//std::cout << prog << std::endl; // std::cout << prog << std::endl;
prog.print_graph(std::cout); prog.print_graph(std::cout);
} }
} }
...@@ -54,10 +54,7 @@ static void print_instruction(std::ostream& os, ...@@ -54,10 +54,7 @@ static void print_instruction(std::ostream& os,
os << " -> " << ins->get_shape(); os << " -> " << ins->get_shape();
} }
static std::string enclose_name(const std::string& name) static std::string enclose_name(const std::string& name) { return '"' + name + '"'; }
{
return '"' + name + '"';
}
static void print_graph_node(std::ostream& os, static void print_graph_node(std::ostream& os,
instruction_ref ins, instruction_ref ins,
...@@ -84,12 +81,16 @@ static void print_graph_node(std::ostream& os, ...@@ -84,12 +81,16 @@ static void print_graph_node(std::ostream& os,
// else // else
// os << "{" << ins->get_literal() << "}"; // os << "{" << ins->get_literal() << "}";
// } // }
} }
template <class F> template <class F>
static void print_program(std::ostream& os, const program& p, F annonate, static void print_program(
std::function<void(std::ostream&,instruction_ref,const std::unordered_map<instruction_ref, std::string>&)>print_func=print_instruction) std::ostream& os,
const program& p,
F annonate,
std::function<void(
std::ostream&, instruction_ref, const std::unordered_map<instruction_ref, std::string>&)>
print_func = print_instruction)
{ {
std::unordered_map<instruction_ref, std::string> names; std::unordered_map<instruction_ref, std::string> names;
int count = 0; int count = 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