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