Commit c40d667e authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 140fde0a
...@@ -18,7 +18,7 @@ struct binary : op_name<Derived> ...@@ -18,7 +18,7 @@ struct binary : op_name<Derived>
return {s.type()}; return {s.type()};
return {s.type(), s.lens()}; return {s.type(), s.lens()};
} }
argument compute(const shape& output_shape, std::vector<argument> args) const argument compute(const shape& output_shape, std::vector<argument> args) const
{ {
argument result{output_shape}; argument result{output_shape};
......
...@@ -30,7 +30,7 @@ struct convert : unary<convert> ...@@ -30,7 +30,7 @@ struct convert : unary<convert>
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
check_shapes{inputs, *this}.has(1); check_shapes{inputs, *this}.has(1);
if (inputs.at(0).packed()) if(inputs.at(0).packed())
{ {
return {target_type, inputs.at(0).lens(), inputs.at(0).strides()}; return {target_type, inputs.at(0).lens(), inputs.at(0).strides()};
} }
...@@ -45,8 +45,8 @@ struct convert : unary<convert> ...@@ -45,8 +45,8 @@ struct convert : unary<convert>
return [](auto x) { return x; }; return [](auto x) { return x; };
} }
convert(shape::type_t t) : target_type{t} { } convert(shape::type_t t) : target_type{t} {}
convert() { } convert() {}
}; };
} // namespace op } // namespace op
......
...@@ -24,9 +24,9 @@ struct unary : op_name<Derived> ...@@ -24,9 +24,9 @@ struct unary : op_name<Derived>
if(input.get_shape().packed()) if(input.get_shape().packed())
{ {
std::transform(input.begin(), std::transform(input.begin(),
input.end(), input.end(),
output.begin(), output.begin(),
static_cast<const Derived&>(*this).apply()); static_cast<const Derived&>(*this).apply());
return result; return result;
} }
......
...@@ -28,12 +28,10 @@ TEST_CASE(param_add) ...@@ -28,12 +28,10 @@ TEST_CASE(param_add)
migraphx::program p; migraphx::program p;
migraphx::shape s{migraphx::shape::float_type, {2, 3}}; migraphx::shape s{migraphx::shape::float_type, {2, 3}};
auto p1 = p.add_parameter("x", s); auto p1 = p.add_parameter("x", s);
auto hp1 = p.insert_instruction( auto hp1 = p.insert_instruction(std::next(p1), migraphx::op::convert{}, p1);
std::next(p1), migraphx::op::convert{}, p1);
auto p2 = p.add_parameter("y", s); auto p2 = p.add_parameter("y", s);
auto hp2 = p.insert_instruction( auto hp2 = p.insert_instruction(std::next(p2), migraphx::op::convert{}, p2);
std::next(p2), migraphx::op::convert{}, p2); auto hs = p.add_instruction(migraphx::op::add{}, hp1, hp2);
auto hs = p.add_instruction(migraphx::op::add{}, hp1, hp2);
p.add_instruction(migraphx::op::convert{migraphx::shape::float_type}, hs); p.add_instruction(migraphx::op::convert{migraphx::shape::float_type}, hs);
return p; return p;
......
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