Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Aug 29, 2022
1 parent 20a2796 commit f104f7a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
18 changes: 0 additions & 18 deletions cinn/hlir/op/contrib/squeeze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ std::vector<Type> InferDtypeForSqueeze(const std::vector<Type> &inputs_type, con
return res;
}

std::vector<std::vector<std::string>> InferLayoutForSqueeze(const std::vector<framework::shape_t> &input_shapes,
const std::vector<std::string> &input_layouts,
const framework::NodeAttr &attrs,
const Target &target) {
CHECK_EQ(input_shapes.size(), 1U) << "The input's shape size is not 1! Please check again.";
CHECK_EQ(input_layouts.size(), 1U) << "The input's layout size is not 1! Please check again.";
std::vector<std::string> new_input_layouts = input_layouts;
if (input_shapes[0].size() > 4) {
// alter input layout back
new_input_layouts[0] = "NCHW";
VLOG(3) << "alter input layout from " << input_layouts[0] << " to " << new_input_layouts[0];
}
return {new_input_layouts, new_input_layouts};
}

} // namespace op
} // namespace hlir
} // namespace cinn
Expand All @@ -215,9 +200,6 @@ CINN_REGISTER_HELPER(squeeze_ops) {
.set_attr<cinn::hlir::framework::StrategyFunction>("CINNStrategy", cinn::hlir::op::StrategyForSqueeze)
.set_attr("infershape", MakeOpFunction(cinn::hlir::op::InferShapeForSqueeze))
.set_attr("inferdtype", MakeOpFunction(cinn::hlir::op::InferDtypeForSqueeze))
#ifndef CINN_WITH_CUDA
.set_attr("inferlayout", MakeOpFunction(cinn::hlir::op::InferLayoutForSqueeze))
#endif
.set_support_level(4);

return true;
Expand Down
2 changes: 0 additions & 2 deletions python/tests/ops/test_squeeze_op.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

# Copyright (c) 2022 CINN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit f104f7a

Please sign in to comment.