Skip to content

Commit

Permalink
Fix failing tidy checks and remove leftover debug prints.
Browse files Browse the repository at this point in the history
Signed-off-by: Mirza Halilcevic <[email protected]>
  • Loading branch information
mirza-halilcevic committed Feb 5, 2025
1 parent b728257 commit 457c5c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/onnx/conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void recalc_conv_attributes(value& v, size_t kdims)

static instruction_ref apply_nhwc_perm(const onnx_parser::node_info& info,
instruction_ref ins,
std::function<void(std::vector<int>&)> f)
const std::function<void(std::vector<int>&)>& f)
{
std::vector<int> perm(ins->get_shape().ndim());
std::iota(begin(perm), end(perm), 0);
Expand All @@ -62,18 +62,18 @@ static instruction_ref apply_nhwc_perm(const onnx_parser::node_info& info,
instruction_ref from_nhwc(const onnx_parser::node_info& info, instruction_ref ins)
{
return apply_nhwc_perm(info, ins, [](std::vector<int>& perm) {
auto C = perm.back();
auto c = perm.back();
perm.pop_back();
perm.insert(begin(perm) + 1, C);
perm.insert(begin(perm) + 1, c);
});
}

instruction_ref to_nhwc(const onnx_parser::node_info& info, instruction_ref ins)
{
return apply_nhwc_perm(info, ins, [](std::vector<int>& perm) {
auto C = perm.at(1);
auto c = perm.at(1);
perm.erase(begin(perm) + 1);
perm.push_back(C);
perm.push_back(c);
});
}

Expand Down
6 changes: 0 additions & 6 deletions test/onnx/verify/nhwcconv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@ TEST_CASE(nhwcconv_test)
{
migraphx::program p = read_onnx("nhwcconv_test.onnx");

std::cout << "BEFORE COMPILE" << std::endl;
p.debug_print();

migraphx::compile_options opts;
opts.offload_copy = true;
p.compile(migraphx::make_target("gpu"), opts);

std::cout << "AFTER COMPILE" << std::endl;
p.debug_print();

migraphx::shape x_shape{migraphx::shape::float_type, {1, 7, 7, 1}};
std::vector<float> x_data = {
0.45246148109436035f, 0.15498268604278564f, 0.11199361085891724f,
Expand Down

0 comments on commit 457c5c6

Please sign in to comment.