"vscode:/vscode.git/clone" did not exist on "d92328f9becb36410c1d28785349630da634370d"
Commit b2f08d98 authored by Paul's avatar Paul
Browse files

Format

parent 26277ec5
......@@ -65,13 +65,15 @@ vectorize vectorize::elements(std::size_t axis, const std::vector<shape>& inputs
return 1;
if(len == 1 and input.elements() > sizes.front())
return sizes.front();
auto it = std::find_if(
sizes.begin(), sizes.end(), [&](auto vsize) {
// The len is divisible by the size and all the strides are divisible by the size
return (len % vsize) == 0 and std::all_of(input.strides().begin(), input.strides().end(), [&](auto i) {
return contains({0, 1}, i) or i % vsize == 0;
});
});
auto it = std::find_if(sizes.begin(), sizes.end(), [&](auto vsize) {
// The len is divisible by the size and all the strides are divisible by
// the size
return (len % vsize) == 0 and
std::all_of(
input.strides().begin(), input.strides().end(), [&](auto i) {
return contains({0, 1}, i) or i % vsize == 0;
});
});
if(it != sizes.end())
return *it;
return 1;
......
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