Commit 323f2714 authored by Paul's avatar Paul
Browse files

Formatting

parent f3b6bc41
...@@ -41,7 +41,8 @@ struct onnx_parser ...@@ -41,7 +41,8 @@ struct onnx_parser
{ {
using attribute_map = std::unordered_map<std::string, onnx::AttributeProto>; using attribute_map = std::unordered_map<std::string, onnx::AttributeProto>;
using node_map = std::unordered_map<std::string, onnx::NodeProto>; using node_map = std::unordered_map<std::string, onnx::NodeProto>;
using op_func = std::function<rtg::instruction_ref(attribute_map, std::vector<rtg::instruction_ref>)>; using op_func =
std::function<rtg::instruction_ref(attribute_map, std::vector<rtg::instruction_ref>)>;
node_map nodes; node_map nodes;
std::unordered_map<std::string, rtg::instruction_ref> instructions; std::unordered_map<std::string, rtg::instruction_ref> instructions;
rtg::program prog = rtg::program(); rtg::program prog = rtg::program();
......
...@@ -20,8 +20,8 @@ program::~program() noexcept = default; ...@@ -20,8 +20,8 @@ program::~program() noexcept = default;
instruction_ref program::add_instruction(operation op, std::vector<instruction_ref> args) instruction_ref program::add_instruction(operation op, std::vector<instruction_ref> args)
{ {
assert( assert(std::all_of(
std::all_of(args.begin(), args.end(), [&](instruction_ref x) { return has_instruction(x); }) && args.begin(), args.end(), [&](instruction_ref x) { return has_instruction(x); }) &&
"Argument is not an exisiting instruction"); "Argument is not an exisiting instruction");
std::vector<shape> shapes(args.size()); std::vector<shape> shapes(args.size());
std::transform( std::transform(
...@@ -46,10 +46,10 @@ instruction_ref program::add_parameter(std::string name, shape s) ...@@ -46,10 +46,10 @@ instruction_ref program::add_parameter(std::string name, shape s)
bool program::has_instruction(instruction_ref ins) const bool program::has_instruction(instruction_ref ins) const
{ {
return std::find_if(impl->instructions.begin(), return std::find_if(
impl->instructions.end(), impl->instructions.begin(), impl->instructions.end(), [&](const instruction& x) {
[&](const instruction& x) { return std::addressof(*ins) == std::addressof(x); }) != return std::addressof(*ins) == std::addressof(x);
impl->instructions.end(); }) != impl->instructions.end();
} }
literal program::eval(std::unordered_map<std::string, argument> params) const literal program::eval(std::unordered_map<std::string, argument> params) const
......
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