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

clang format

parent cced8ba3
...@@ -21,7 +21,7 @@ struct binary ...@@ -21,7 +21,7 @@ struct binary
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
check_shapes{inputs}.has(2).same_type().same_dims(); check_shapes{inputs}.has(2).same_type().same_dims();
if (inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed()) if(inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
......
...@@ -21,7 +21,7 @@ struct unary ...@@ -21,7 +21,7 @@ struct unary
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
check_shapes{inputs}.has(1); check_shapes{inputs}.has(1);
if (inputs.front().packed()) if(inputs.front().packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
......
...@@ -593,9 +593,9 @@ struct cpu_unary ...@@ -593,9 +593,9 @@ struct cpu_unary
{ {
Op op; Op op;
std::string name() const { return op.name(); } std::string name() const { return op.name(); }
shape compute_shape(const std::vector<shape>& inputs) const shape compute_shape(const std::vector<shape>& inputs) const
{ {
if (inputs.at(0).packed()) if(inputs.at(0).packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
...@@ -793,9 +793,9 @@ struct cpu_binary ...@@ -793,9 +793,9 @@ struct cpu_binary
{ {
Op op; Op op;
std::string name() const { return op.name(); } std::string name() const { return op.name(); }
shape compute_shape(const std::vector<shape>& inputs) const shape compute_shape(const std::vector<shape>& inputs) const
{ {
if (inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed()) if(inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
...@@ -804,7 +804,7 @@ struct cpu_binary ...@@ -804,7 +804,7 @@ struct cpu_binary
return {inputs.at(0).type(), inputs.at(0).lens()}; return {inputs.at(0).type(), inputs.at(0).lens()};
} }
} }
argument compute(context&, const shape& output_shape, std::vector<argument> args) const argument compute(context&, const shape& output_shape, std::vector<argument> args) const
{ {
argument result{output_shape}; argument result{output_shape};
......
...@@ -45,7 +45,7 @@ struct unary_device : oper<Derived> ...@@ -45,7 +45,7 @@ struct unary_device : oper<Derived>
shape compute_shape(const std::vector<shape>& inputs) const shape compute_shape(const std::vector<shape>& inputs) const
{ {
check_shapes{inputs, *this}.has(2); check_shapes{inputs, *this}.has(2);
if (inputs.at(0).packed()) if(inputs.at(0).packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
...@@ -70,7 +70,7 @@ struct binary_device : oper<Derived> ...@@ -70,7 +70,7 @@ struct binary_device : oper<Derived>
shape compute_shape(const std::vector<shape>& inputs) const shape compute_shape(const std::vector<shape>& inputs) const
{ {
check_shapes{inputs, *this}.has(3); check_shapes{inputs, *this}.has(3);
if (inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed()) if(inputs.at(0) == inputs.at(1) and inputs.at(0).packed() and inputs.at(1).packed())
{ {
return inputs.at(0); return inputs.at(0);
} }
......
...@@ -335,7 +335,7 @@ struct test_trans_tanh : verify_program<test_trans_tanh> ...@@ -335,7 +335,7 @@ struct test_trans_tanh : verify_program<test_trans_tanh>
auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}}); auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}});
auto tx = p.add_instruction(migraphx::op::transpose{{0, 1, 3, 2}}, x); auto tx = p.add_instruction(migraphx::op::transpose{{0, 1, 3, 2}}, x);
auto tanhx = p.add_instruction(migraphx::op::tanh{}, tx); auto tanhx = p.add_instruction(migraphx::op::tanh{}, tx);
auto r = p.add_instruction(migraphx::op::add{}, tanhx, tanhx); auto r = p.add_instruction(migraphx::op::add{}, tanhx, tanhx);
p.add_instruction(migraphx::op::contiguous{}, r); p.add_instruction(migraphx::op::contiguous{}, r);
return p; return p;
...@@ -697,9 +697,9 @@ struct test_trans_abs : verify_program<test_trans_abs> ...@@ -697,9 +697,9 @@ struct test_trans_abs : verify_program<test_trans_abs>
auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}}); auto x = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}});
auto tx = p.add_instruction(migraphx::op::transpose{{0, 1, 3, 2}}, x); auto tx = p.add_instruction(migraphx::op::transpose{{0, 1, 3, 2}}, x);
auto absx = p.add_instruction(migraphx::op::abs{}, tx); auto absx = p.add_instruction(migraphx::op::abs{}, tx);
auto r = p.add_instruction(migraphx::op::add{}, absx, absx); auto r = p.add_instruction(migraphx::op::add{}, absx, absx);
p.add_instruction(migraphx::op::contiguous{}, r); p.add_instruction(migraphx::op::contiguous{}, r);
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