Commit 8a4f5778 authored by Khalique's avatar Khalique
Browse files

formatting

parent 461a68cc
......@@ -43,7 +43,7 @@ struct tf_parser
copy(attrs.begin(), attrs.end(), std::back_inserter(axes));
if(is_nhwc)
{
for(size_t& axis: axes)
for(size_t& axis : axes)
{
parse_axis(axis);
}
......@@ -236,15 +236,15 @@ struct tf_parser
attribute_map attributes,
const std::vector<instruction_ref>&)
{
literal v = parse_tensor(attributes.at("value").tensor());
auto l0 = prog.add_literal(v);
literal v = parse_tensor(attributes.at("value").tensor());
auto l0 = prog.add_literal(v);
size_t num_axes = l0->get_shape().lens().size();
if(num_axes >= 4)
{
std::vector<int64_t> transpose_axes = get_axes(num_axes);
reorder_data(transpose_axes);
l0 = prog.add_instruction(op::transpose{transpose_axes}, l0);
}
}
return l0;
}
......@@ -306,7 +306,7 @@ struct tf_parser
{
l0 = prog.add_instruction(op::transpose{{1, 3, 0, 2}}, args[1]);
}
else if (l0->name() != "@param")
else if(l0->name() != "@param")
MIGRAPHX_THROW("cannot infer data format for weights");
return prog.add_instruction(op, {args[0], l0});
......@@ -424,8 +424,8 @@ struct tf_parser
{
reorder_data(dims);
}
shape s = shape{shape_type, dims};
instructions[name] = prog.add_parameter(name, s);
shape s = shape{shape_type, dims};
instructions[name] = prog.add_parameter(name, s);
}
for(auto&& p : nodes)
{
......
......@@ -101,9 +101,10 @@ TEST_CASE(conv_test)
migraphx::program p;
auto l0 = p.add_parameter("0", migraphx::shape{migraphx::shape::float_type, {1, 3, 16, 16}});
std::vector<float> weight_data(3*3*3*32);
std::vector<float> weight_data(3 * 3 * 3 * 32);
std::fill(weight_data.begin(), weight_data.end(), 1.0f);
auto l1 = p.add_literal(migraphx::shape{migraphx::shape::float_type, {3, 3, 3, 32}}, weight_data);
auto l1 =
p.add_literal(migraphx::shape{migraphx::shape::float_type, {3, 3, 3, 32}}, weight_data);
migraphx::op::convolution op;
op.padding_mode = migraphx::op::padding_mode_t::same;
......
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