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

clang format

parent 9ea01307
...@@ -18,7 +18,7 @@ namespace op { ...@@ -18,7 +18,7 @@ namespace op {
struct argmax struct argmax
{ {
int axis = 0; int axis = 0;
template <class Self, class F> template <class Self, class F>
static auto reflect(Self& self, F f) static auto reflect(Self& self, F f)
......
...@@ -18,7 +18,7 @@ namespace op { ...@@ -18,7 +18,7 @@ namespace op {
struct argmin struct argmin
{ {
int axis = 0; int axis = 0;
template <class Self, class F> template <class Self, class F>
static auto reflect(Self& self, F f) static auto reflect(Self& self, F f)
......
...@@ -284,7 +284,7 @@ struct onnx_parser ...@@ -284,7 +284,7 @@ struct onnx_parser
keep_dims = parse_value(attributes.at("keepdims")).at<int>(); keep_dims = parse_value(attributes.at("keepdims")).at<int>();
} }
if (keep_dims == 0) if(keep_dims == 0)
{ {
auto ins = prog.add_instruction(op::argmax{axis}, std::move(args)); auto ins = prog.add_instruction(op::argmax{axis}, std::move(args));
return prog.add_instruction(op::squeeze{{static_cast<int64_t>(axis)}}, ins); return prog.add_instruction(op::squeeze{{static_cast<int64_t>(axis)}}, ins);
...@@ -311,7 +311,7 @@ struct onnx_parser ...@@ -311,7 +311,7 @@ struct onnx_parser
keep_dims = parse_value(attributes.at("keepdims")).at<int>(); keep_dims = parse_value(attributes.at("keepdims")).at<int>();
} }
if (keep_dims == 0) if(keep_dims == 0)
{ {
auto ins = prog.add_instruction(op::argmin{axis}, std::move(args)); auto ins = prog.add_instruction(op::argmin{axis}, std::move(args));
return prog.add_instruction(op::squeeze{{static_cast<int64_t>(axis)}}, ins); return prog.add_instruction(op::squeeze{{static_cast<int64_t>(axis)}}, ins);
......
...@@ -787,7 +787,7 @@ TEST_CASE(logsoftmax) ...@@ -787,7 +787,7 @@ TEST_CASE(logsoftmax)
TEST_CASE(argmax) TEST_CASE(argmax)
{ {
migraphx::program p; migraphx::program p;
auto l0 = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}}); auto l0 = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}});
auto ins = p.add_instruction(migraphx::op::argmax{2}, l0); auto ins = p.add_instruction(migraphx::op::argmax{2}, l0);
p.add_instruction(migraphx::op::squeeze{{2}}, ins); p.add_instruction(migraphx::op::squeeze{{2}}, ins);
auto prog = migraphx::parse_onnx("argmax_test.onnx"); auto prog = migraphx::parse_onnx("argmax_test.onnx");
...@@ -798,7 +798,7 @@ TEST_CASE(argmax) ...@@ -798,7 +798,7 @@ TEST_CASE(argmax)
TEST_CASE(argmin) TEST_CASE(argmin)
{ {
migraphx::program p; migraphx::program p;
auto l0 = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}}); auto l0 = p.add_parameter("x", migraphx::shape{migraphx::shape::float_type, {3, 4, 5, 6}});
auto ins = p.add_instruction(migraphx::op::argmin{3}, l0); auto ins = p.add_instruction(migraphx::op::argmin{3}, l0);
p.add_instruction(migraphx::op::squeeze{{3}}, ins); p.add_instruction(migraphx::op::squeeze{{3}}, ins);
auto prog = migraphx::parse_onnx("argmin_test.onnx"); auto prog = migraphx::parse_onnx("argmin_test.onnx");
......
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