Commit a86c351b authored by Paul's avatar Paul
Browse files

Sort parameter names

parent f4ac55be
......@@ -48,7 +48,10 @@ struct find_conv_pointwise
});
mm.add_return(mm.insert_module_instructions(mm.end(), pm, param_map));
auto inputs = ins->inputs();
std::vector<instruction_ref> inputs;
std::copy_if(ins->inputs().begin(), ins->inputs().end(), std::back_inserter(inputs), [&](auto input) {
return input != conv_ins;
});
inputs.insert(inputs.end(), conv_ins->inputs().begin(), conv_ins->inputs().end());
inputs.push_back(m.insert_instruction(
ins, make_op("hip::allocate", {{"shape", to_value(ins->get_shape())}})));
......
......@@ -386,6 +386,7 @@ struct mlir_program
insert(MlirBlock body, const module& m, std::unordered_map<instruction_ref, MlirValue>& ins_map)
{
auto names = m.get_parameter_names();
std::sort(names.begin(), names.end());
std::vector<shape> inputs;
std::transform(names.begin(),
names.end(),
......@@ -522,6 +523,7 @@ instruction_ref insert_mlir(module& m,
const module& mmlir,
const std::vector<instruction_ref>& inputs)
{
assert(mmlir.get_parameter_names().size() == inputs.size() - 1);
auto co = compile_mlir(mmlir);
std::vector<instruction_ref> refs;
......
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