Commit cce6db32 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Always add contiguous to reshapes

this will get filtered out once proper order and aliasing is determined
parent 8887216b
......@@ -54,7 +54,8 @@ struct parse_reshape : op_parser<parse_reshape>
}
auto cont = info.add_instruction(make_op("contiguous"), args[0]);
return info.add_instruction(make_op("reshape", {{"dims", dims}}), cont);
auto resh = info.add_instruction(make_op("reshape", {{"dims", dims}}), cont);
return info.add_instruction(make_op("contiguous"), resh);
}
};
......
......@@ -45,8 +45,9 @@ struct parse_reshape : op_parser<parse_reshape>
auto s = args[1]->eval();
std::vector<int64_t> dims;
s.visit([&](auto v) { copy(v, std::back_inserter(dims)); });
return info.add_instruction(make_op("reshape", {{"dims", dims}}),
auto resh = info.add_instruction(make_op("reshape", {{"dims", dims}}),
info.make_contiguous(args[0]));
return info.make_contiguous(resh);
}
};
......
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