Commit d068a978 authored by Paul's avatar Paul
Browse files

Format

parent c97080ce
...@@ -92,7 +92,7 @@ template <class T> ...@@ -92,7 +92,7 @@ template <class T>
auto to_value_impl(rank<4>, const optional<T>& x) auto to_value_impl(rank<4>, const optional<T>& x)
{ {
value result{}; value result{};
if (x.has_value()) if(x.has_value())
to_value(*x); to_value(*x);
return result; return result;
} }
...@@ -208,7 +208,7 @@ void from_value_impl(rank<5>, const value& v, T& x) ...@@ -208,7 +208,7 @@ void from_value_impl(rank<5>, const value& v, T& x)
template <class T> template <class T>
void from_value_impl(rank<6>, const value& v, optional<T>& x) void from_value_impl(rank<6>, const value& v, optional<T>& x)
{ {
if (not v.is_null()) if(not v.is_null())
x = from_value<T>(v); x = from_value<T>(v);
} }
......
...@@ -103,7 +103,7 @@ void stream_write_value_impl(rank<0>, std::ostream& os, const T& x) ...@@ -103,7 +103,7 @@ void stream_write_value_impl(rank<0>, std::ostream& os, const T& x)
template <class T> template <class T>
void stream_write_value_impl(rank<0>, std::ostream& os, const optional<T>& x) void stream_write_value_impl(rank<0>, std::ostream& os, const optional<T>& x)
{ {
if (x.has_value()) if(x.has_value())
stream_write_value_impl(rank<2>{}, os, *x); stream_write_value_impl(rank<2>{}, os, *x);
else else
os << "none"; os << "none";
......
...@@ -64,7 +64,7 @@ struct precompile_op ...@@ -64,7 +64,7 @@ struct precompile_op
r = op.compute_shape(inputs); r = op.compute_shape(inputs);
else else
r = op.compute_shape(inputs, mods); r = op.compute_shape(inputs, mods);
if (output_shape.has_value()) if(output_shape.has_value())
r = *output_shape; r = *output_shape;
return r; return r;
} }
......
...@@ -668,7 +668,8 @@ struct find_contiguous_tranpose_precompile ...@@ -668,7 +668,8 @@ struct find_contiguous_tranpose_precompile
auto transpose = r.instructions["transpose"]; auto transpose = r.instructions["transpose"];
auto perm = transpose->get_operator().to_value()["permutation"].to_vector<int64_t>(); auto perm = transpose->get_operator().to_value()["permutation"].to_vector<int64_t>();
auto iperm = invert_permutation(perm); auto iperm = invert_permutation(perm);
auto s = shape::from_permutation(op_ins->get_shape().type(), op_ins->get_shape().lens(), iperm); auto s =
shape::from_permutation(op_ins->get_shape().type(), op_ins->get_shape().lens(), iperm);
auto v = op_ins->get_operator().to_value(); auto v = op_ins->get_operator().to_value();
v["output_shape"] = to_value(s); v["output_shape"] = to_value(s);
auto new_op = make_op("gpu::precompile_op", v); auto new_op = make_op("gpu::precompile_op", v);
......
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