Commit 42f00caa authored by wsttiger's avatar wsttiger
Browse files

converted to std::any_of

parent 5d612a82
...@@ -365,13 +365,11 @@ struct squeeze ...@@ -365,13 +365,11 @@ struct squeeze
auto input_shape = inputs[0]; auto input_shape = inputs[0];
auto type = input_shape.type(); auto type = input_shape.type();
auto old_lens = input_shape.lens(); auto old_lens = input_shape.lens();
for(auto axis : axes) if(std::any_of(
{ axes.begin(), axes.end(), [&](auto axis) { return input_shape.lens()[axis] != 1; }))
if(input_shape.lens()[axis] != 1)
{ {
MIGRAPH_THROW("squeeze axis dimension should be equal to 1"); MIGRAPH_THROW("squeeze axis dimension should be equal to 1");
} }
}
std::vector<std::size_t> new_lens; std::vector<std::size_t> new_lens;
if(axes.empty()) if(axes.empty())
{ {
......
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