Commit 5f7826da authored by Paul's avatar Paul
Browse files

Formatting

parent dcb15c2b
......@@ -52,7 +52,7 @@ std::vector<int64_t> reorder_dims(std::vector<int64_t> dims, std::vector<int64_t
{
std::vector<int64_t> result(dims.size());
assert(dims.size() == permutation.size());
for(std::size_t i = 0;i <dims.size();i++)
for(std::size_t i = 0; i < dims.size(); i++)
{
result[i] = dims[permutation[i]];
}
......@@ -61,13 +61,12 @@ std::vector<int64_t> reorder_dims(std::vector<int64_t> dims, std::vector<int64_t
bool is_no_transpose(const std::vector<int64_t>& dims)
{
if (dims.empty())
if(dims.empty())
return true;
if (dims.front() != 0)
if(dims.front() != 0)
return false;
return std::adjacent_find(dims.begin(), dims.end(), [](auto x, auto y) {
return (y - x) != 1;
}) == dims.end();
return std::adjacent_find(
dims.begin(), dims.end(), [](auto x, auto y) { return (y - x) != 1; }) == dims.end();
}
void simplify_reshapes::apply(program& p) const
......@@ -127,7 +126,7 @@ void simplify_reshapes::apply(program& p) const
} while(x != t and t->name() == "transpose");
if(t == ins or t->name() != "transpose")
continue;
if (is_no_transpose(dims))
if(is_no_transpose(dims))
{
p.replace_instruction(ins, t->inputs().front());
}
......
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