Commit a2f3bd24 authored by Paul's avatar Paul
Browse files

Formatting

parent e59e3058
......@@ -46,10 +46,7 @@ struct onnx_parser
std::unordered_map<std::string, rtg::instruction*> instructions;
rtg::program prog = rtg::program();
std::unordered_map<
std::string,
op_func>
ops;
std::unordered_map<std::string, op_func> ops;
onnx_parser()
{
......
......@@ -12,9 +12,7 @@ struct program_impl
std::list<instruction> instructions;
};
program::program()
: impl(std::make_unique<program_impl>())
{}
program::program() : impl(std::make_unique<program_impl>()) {}
program::program(program&&) noexcept = default;
program& program::operator=(program&&) = default;
......@@ -22,8 +20,8 @@ program::~program() = default;
instruction* program::add_instruction(operation op, std::vector<instruction*> args)
{
assert(std::all_of(
args.begin(), args.end(), [&](instruction* x) { return has_instruction(x); }) &&
assert(
std::all_of(args.begin(), args.end(), [&](instruction* x) { return has_instruction(x); }) &&
"Argument is not an exisiting instruction");
std::vector<shape> shapes(args.size());
std::transform(
......@@ -48,9 +46,10 @@ instruction* program::add_parameter(std::string name, shape s)
bool program::has_instruction(const instruction* ins) const
{
return std::find_if(impl->instructions.begin(), impl->instructions.end(), [&](const instruction& x) {
return ins == std::addressof(x);
}) != impl->instructions.end();
return std::find_if(impl->instructions.begin(),
impl->instructions.end(),
[&](const instruction& x) { return ins == std::addressof(x); }) !=
impl->instructions.end();
}
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